Laravel 403禁止错误 [英] Laravel 403 Forbidden Error
问题描述
正如标题所述,我在Laravel项目上收到错误403(页面标题).在本地,它可以正常工作,但是当我尝试将其发布时,在Web主机/我的域上,它可以为我提供:
As title said, I got error 403 (title of page) on Laravel project. Locally, it's working, but when I'm trying to put it live, on a web-host/my domain it gives me:
禁止
您无权访问此服务器上的/.
此外,尝试使用ErrorDocument处理请求时遇到404未找到错误.
Forbidden
You don't have permission to access / on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
我从公用文件夹中删除了.htaccess
文件,没有任何反应.
有解决方案吗?
I deleted .htaccess
file from public folder, and nothing happened.
Any solutions?
推荐答案
如果您使用自己的Request,请将authorize函数更改为true:
If you are using your own Request, change the authorize function to return true:
public function authorize()
{
return true;
}
就这么简单!
这篇关于Laravel 403禁止错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!