Laravel没有开发基于Linux的Shared Server

时间:2014-04-04 11:19:53

标签: .htaccess configuration laravel

有人知道如何设置Laravel它可以在基于Linux的共享服务器上运行吗? 我尝试过默认和替代的.htaccess文件:

  • 当我输入一个不存在但未在routes.php中定义的url时,我得到了这个:

内部服务器错误

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.
  • 当我输入一个url到一个存在但未在routes.php中定义的文件夹时,我得到一个Redirect Loop
  • 当我输入一个存在但未在routes.php中定义的文件的URL时,我得到的错误就像第一个

这里我试过的.htaccess文件(两者都表现相同)

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

    RewriteEngine On

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

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

Options +FollowSymLinks
RewriteEngine On

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

0 个答案:

没有答案