Apache 2.4 - 由于可能的配置错误,请求超出了 10 个内部重定向的限制 [英] Apache 2.4 - Request exceeded the limit of 10 internal redirects due to probable configuration error

查看:51
本文介绍了Apache 2.4 - 由于可能的配置错误,请求超出了 10 个内部重定向的限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Windows Server 2008 R2 Enterprise 上运行 Apache 2.4(64 位)和 PHP 5.4.15,并注意到 Apache 错误日志中出现以下错误:

I'm running Apache 2.4 (64bit) and PHP 5.4.15 on windows Server 2008 R2 Enterprise and have noticed the following error in the Apache error log:

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 重写中的错误.

I have a multisite install of WordPress running and I think the error is coming from an error in the htaccess rewrites.

看这篇文章:请求超出了 10 个内部重定向的限制由于可能的配置错误.?

他们建议替换这个:

# 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 提供:

with this piece of code, courtesy of 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 看起来有点不同,所以我不想只替换我的代码,以防万一我不小心替换了我需要的东西.

However, my WordPress htaccess looks a little different so I dont just want to replace my code just in case I inadvertently replace something that I need.

这是我的 htaccess:

Here is my 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

谁能建议我需要改变什么?

Can anyone suggest what I need to change?

推荐答案

由于这些规则,您很可能会陷入循环:

You're getting into looping most likely due to these rules:

RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]

只需将其注释掉,然后在新浏览器中重试.

Just comment it out and try again in a new browser.

这篇关于Apache 2.4 - 由于可能的配置错误,请求超出了 10 个内部重定向的限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆