繁体   English   中英

Laravel 5在托管中出现500错误

[英]Laravel 5 geting 500 error in hosting

我花了一整晚时间来在托管环境中运行laravel应用程序。

在Mac OS上的localhost中,一切正常,但是在ubuntu上的托管中,我得到500错误。

我没有任何线索。

根目录中的.htaccess

Options -Indexes

<IfModule mod_rewrite.c>
  RewriteEngine on

  RewriteCond %{REQUEST_URI} !^public
  RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

# Deny accessing below extensions
<Files ~ "(\.json|\.lock|\.git)">
Order allow,deny
Deny from all
</Files>

# Deny accessing dot files
RewriteRule (^\.|/\.) - [F]

和.htaccess在公共场合

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

RewriteEngine On

# Redirect Trailing Slashes...
RewriteBase /
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

如果删除/public/.htaccess,则会收到server error 500

否则我会收到Server error The website encountered an error while retrieving http://oboi.spb.ru/. It may be down for maintenance or configured incorrectly. Server error The website encountered an error while retrieving http://oboi.spb.ru/. It may be down for maintenance or configured incorrectly.

条件 :

  RewriteCond %{REQUEST_URI} !^public

之所以失败,是因为您在Cond模式中缺少在公众面前的/ ,因此该规则被应用到每个请求上,从而导致无限递归。

将条件模式更改为

!^/public

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM