Apache配置Laravel報You don't have permission to access this resource

Apache配置Laravel報:You don’t have permission to access this resource.

當你配置完Apache後,就在你輸入域名時,很好,沒啥問題,但,就當你敲下回車鍵的這一瞬間,就在這一瞬間出現了這個東西:
You don’t have permission to access this resource.
在這裏插入圖片描述

解決方案

Apache 服務器

Laravel框架通過設置 public/.htaccess 文件去除鏈接中的index.php。 如果你你的服務器使用的是Apache,請開啓mod_rewrite 模塊。

如果框架附帶的 .htaccess 文件在你的Apache環境中不起作用,請在.htaccess後面添加:

Options +FollowSymLinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ http://%{HTTP_HOST}/$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

成功之後出現這個頁面

在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章