【发布时间】:2014-01-25 04:51:29
【问题描述】:
我有以下 .htacess 文件来删除 .php 扩展名并创建 SEO 友好 URL:
RewriteEngine On
ErrorDocument 404 /404.php
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^(.+)\.php$ /$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*)$ index.php?page=$1 [L]
当托管在我们的域上时,这绝对可以正常工作,但是当我在本地主机服务器上进行本地测试时,它会出现错误 500,内部服务器错误。
在我的 httpd.conf 文件中,rewrite 模块没有注释:
LoadModule rewrite_module modules/mod_rewrite.so
Apache 错误日志指出:
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., referer: http://localhost:8888/Website/
有什么想法吗?
【问题讨论】:
标签: apache .htaccess mod-rewrite http-redirect