【发布时间】:2014-05-10 12:14:27
【问题描述】:
我在 windows Server 2008 R2 Enterprise 上运行 Apache 2.4(64 位)和 PHP 5.4.15,并注意到 Apache 错误日志中出现以下错误:
AH00124: 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.
我正在运行 WordPress 的多站点安装,我认为错误来自 htaccess 重写中的错误。
看这篇文章: Request exceeded the limit of 10 internal redirects due to probable configuration error.?
他们建议替换这个:
# BEGIN Wordpress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
这段代码由 Scott Yang 提供:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ /index.php/$1 [L,QSA]
</IfModule>
但是,我的 WordPress htaccess 看起来有点不同,所以我不想替换我的代码以防万一我不小心替换了我需要的东西。
这是我的 htaccess:
# BEGIN WordPress
<IfModule mod_rewrite.c>
Options +FollowSymLinks -MultiViews
Header set Access-Control-Allow-Origin "*"
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
</IfModule>
# END WordPress
谁能建议我需要改变什么?
【问题讨论】:
标签: regex wordpress apache .htaccess url-rewriting