Laravel 403禁止错误 [英] Laravel 403 Forbidden Error

查看:377
本文介绍了Laravel 403禁止错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如标题所述,我在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆