【发布时间】:2016-05-17 21:46:12
【问题描述】:
我在共享主机上遇到了 mod_rewrite 和 Laravel 4 的问题。
我已将 public 重命名为 lvrp。重命名本身很好,并且已经在我的本地主机上进行了测试。但是,当上传到 GoDaddy 时,它首先只是抛出了 500 错误。然后又找了一个.htaccess,改成这样:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
它可能不是最好的,但至少它有效。有点。
我可以访问起始页。我无法访问任何其他页面,除非我将 index.php 添加到 URI。使用 index.php,我可以访问每个页面。
关于如何在不添加 index.php 的情况下使其工作的任何想法?
编辑#1:
[error] [client x.x.x.x] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
这是我在 apache 日志中遇到的错误。
【问题讨论】:
-
两个问题:1)您的托管服务器上启用了mod_rewrite? 2) 您是从根 URI 还是在虚拟目录下为您的 Web 应用程序提供服务?
-
mod_rewrite 确实已启用。我的网络应用程序位于 public_html/websites/domainname 中。它可以从 domain.com 访问。如果您明白我的意思,该域直接进入域名文件夹。 @RubensMariuzzo
标签: php apache mod-rewrite laravel