larvel 路由未生效_laravel-5 – 将Laravel 5项目部署到托管后路由无效

在将Laravel 5项目部署到托管服务器后,遇到路由失效问题,表现为点击链接返回500 Internal Server Error。通过修改.htaccess文件中的RewriteBase为/,解决了这个问题。此解决方案可能对遇到相同问题的开发者有所帮助。
摘要由CSDN通过智能技术生成

我刚刚将我的Laravel 5 proyect上传到托管服务器.索引页几乎可以工作,但每个链接都被破坏了.每条路由都返回一个内部服务器错误消息.

这是实际的消息:

Internal Server Error

The server encountered an internal error or misconfiguration and was

unable to complete your request.

Please contact the server administrator, and inform them of the time

the error occurred, and anything you might have done that may have

caused the error.

More information about this error may be available in the server error

log.

Additionally, a 500 Internal Server Error error was encountered while

trying to use an ErrorDocument to handle the request.

我已经将存储文件夹权限设置为777,但我甚至没有收到错误日志.

有什么建议?

最后我可以解决它添加

RewriteBase /

到公用文件夹中的.htaccess文件.

这是我完整的.htaccess文件:

Options -MultiViews

RewriteEngine On

RewriteBase /

# Redirect Trailing Slashes...

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值