【发布时间】:2013-06-17 06:00:06
【问题描述】:
我正在尝试在 php 中设置一个 REST 服务器(Restler),它在 MAMP 中运行良好
但是,一旦我将它放在使用 Cent OS 6.2 的实时服务器上,它就会给我一个 500 错误。是什么原因造成的?
这是htaccess:
DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^$ index.php [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
<IfModule mod_php5.c>
php_flag display_errors On
</IfModule>
重写规则 ^(.*)$ index.php [QSA,L]
^-- 这行似乎是问题所在。
我在日志中看到了这一点:
[Thu Jun 20 09:13:52 2013] [error] [client 5.64.252.223] 由于可能的配置错误,请求超出了 10 个内部重定向的限制。如有必要,使用“LimitInternalRecursion”增加限制。使用“LogLevel debug”获取回溯。
[Thu Jun 20 09:13:52 2013] [debug] core.c(3072): [client 5.64.252.223] r->uri = /lookbunnyfind.com/go/index.php
[Thu Jun 20 09:13:52 2013] [debug] core.c(3078): [client 5.64.252.223] 重定向自 r->uri = /lookbunnyfind.com/go/index.php
[Thu Jun 20 09:13:52 2013] [debug] core.c(3078): [client 5.64.252.223] 重定向自 r->uri = /lookbunnyfind.com/go/index.php
[Thu Jun 20 09:13:52 2013] [debug] core.c(3078): [client 5.64.252.223] 重定向自 r->uri = /lookbunnyfind.com/go/index.php
[Thu Jun 20 09:13:52 2013] [debug] core.c(3078): [client 5.64.252.223] 重定向自 r->uri = /lookbunnyfind.com/go/index.php
[Thu Jun 20 09:13:52 2013] [debug] core.c(3078): [client 5.64.252.223] 重定向自 r->uri = /lookbunnyfind.com/go/index.php
[Thu Jun 20 09:13:52 2013] [debug] core.c(3078): [client 5.64.252.223] 重定向自 r->uri = /lookbunnyfind.com/go/index.php
[Thu Jun 20 09:13:52 2013] [debug] core.c(3078): [client 5.64.252.223] 重定向自 r->uri = /lookbunnyfind.com/go/index.php
[Thu Jun 20 09:13:52 2013] [debug] core.c(3078): [client 5.64.252.223] 重定向自 r->uri = /lookbunnyfind.com/go/index.php
[Thu Jun 20 09:13:52 2013] [debug] core.c(3078): [client 5.64.252.223] 重定向自 r->uri = /lookbunnyfind.com/go/index.php
[Thu Jun 20 09:13:52 2013] [debug] core.c(3078): [client 5.64.252.223] 重定向自 r->uri = /hi
[Thu Jun 20 09:13:52 2013] [debug] mod_deflate.c(602): [client 5.64.252.223] Zlib: Compressed 628 to 389 : URL /lookbunnyfind.com/go/index.php
【问题讨论】:
-
您将索引页面重定向到索引页面意味着无限重定向导致 500 错误。
-
问题是无限重定向,你的go文件夹里有index.php文件吗?
-
可能有两个问题。 1(您正在重定向到无限的索引页面 2(您的 apache 配置中没有启用 mod_rewrite。
-
是的,我的 go 文件夹中有一个 index.php,我应该将 index.php 文件放在哪里?
标签: php apache .htaccess restler