【问题标题】:AH00124: Request exceeded the limit of 10 internal redirects due to probableAH00124:请求超出了 10 个内部重定向的限制,因为可能
【发布时间】:2017-06-01 19:04:18
【问题描述】:

升级我的 Ubuntu 服务器后,我尝试打开我的 wordpress 网站,但我的 error.log 中出现了这个错误

AH00124:由于可能的配置错误,请求超出了 10 个内部重定向的限制。如有必要,使用“LimitInternalRecursion”增加限制。使用“LogLevel debug”获取回溯。

打开网站时收到消息。

<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */

/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define('WP_USE_THEMES', true);

/** Loads the WordPress Environment and Template */
require( dirname( __FILE__ ) . '/wp-blog-header.php' );

我在下面尝试了这 2 个链接,但我的 .htaccess 不同,所以没有用。

Apache 2.4 - Request exceeded the limit of 10 internal redirects due to probable configuration error

Request exceeded the limit of 10 internal redirects due to probable configuration error.?

.htaccess /root

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

.htaccess /blog

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>

# END WordPres

阿帕奇:

Server version: Apache/2.4.18 (Ubuntu)

有人知道如何解决这个问题吗?

谢谢。

【问题讨论】:

  • 也许,您必须将.htaccess 移至/blog
  • 你好,这个.htaccess在/blog里面
  • 您是否移动了您的 wordpress 安装?我不明白只是升级您的服务器会导致错误吗?你还改变了什么?
  • 我今天升级了所有东西,新的ubuntu版本,sql,mysql,apache,所有东西,我只是按ok ok ok :) 哈哈哈
  • 对于通过 Google 来到这里的人,AH00124: Request exceeded the limit of 10 internal redirects due to probable 的解决方案可能在这里 stackoverflow.com/a/48022336/279564

标签: wordpress apache .htaccess mod-rewrite


【解决方案1】:

在无法访问配置文件的共享主机上,我可以通过在 wp-admin 后端重新保存永久链接来解决这个问题。

【讨论】:

  • 这也为我解决了问题
【解决方案2】:

我遇到了这个错误消息的问题,我解决了。

我从 MacOS Catalina 升级到 Big Sur 时遇到了这个问题。

@vineetkumar 和 @blackbam 让我走上了正轨。

这是我必须在 /private/etc/apache2/extra/httpd-vhosts.conf 中进行的修改:

 <VirtualHost *:443>
   ServerName vhost_for_https
   ServerAlias localhost
-  DocumentRoot "/Library/WebServer/Documents/anais_website"
+  DocumentRoot "/Library/WebServer/Documents"
   SSLEngine on
   SSLCertificateFile /private/etc/apache2/ssl/certificate.crt
   SSLCertificateKeyFile /private/etc/apache2/ssl/privateKey.key
-  <Directory "/Library/WebServer/Documents/anais_website">
+  <Directory "/Library/WebServer/Documents">
     Options +Indexes +Includes +FollowSymLinks +MultiViews
     AllowOverride All
     Require local
     Require ip 192.168.1.71
  </Directory>
</VirtualHost>

【讨论】:

    【解决方案3】:

    从给定的以下代码行更新 .htaccess

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress```
    

    【讨论】:

      【解决方案4】:

      不是 apache 的 php 模块,而 apache 将 php 解释为文本。

      为了解决这个问题,我做了:

      apt-get install libapache2-mod-php
      
      /etc/init.d/apache2 restart
      
      apt-get install php7.0-mysql 
      
      /etc/init.d/apache2 restart
      

      【讨论】:

      • 您是如何发现这是问题所在?
      【解决方案5】:

      尝试增加限制,但我猜它是一个循环。下面的文章应该会引导你走向正确的方向:

      https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

      尝试使用两个不同的 .htaccess。在根文件夹中:

      # BEGIN WordPress
      <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteBase /blog/
      RewriteRule ^index\.php$ - [L]
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule . /blog/index.php [L]
      </IfModule>
      
      # END WordPress
      

      ...或者只是确保您重定向到子文件夹。

      在子文件夹中:

      # BEGIN WordPress
      <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteBase /
      RewriteRule ^index\.php$ - [L]
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule . /index.php [L]
      </IfModule>
      # END WordPress
      

      检查您的永久链接设置 home_url 和 blog_url。这也可能导致无限循环。更新您的永久链接并搜索 wp_options 以便为您的博客插入正确的 url/域。

      也可能是 Ubuntu 特定的配置错误,尝试提高限制或检查缺少的库,如 mod_rewrite。

      【讨论】:

      • 重定向发生在哪里?从wordpress内部还是在服务器中?尝试添加 echo 'hello';死;在 wp-config.php 中检查是否到达?
      • 什么都没有发生,网站运行正常,在我更新 apache 和 Ubuntu 之后,这开始发生了
      • 所以 wp-config.php 永远不会到达?
      • 我应该把这个放在里面吗? :
      • 抱歉没时间聊天。您必须检查是否曾经访问过 WordPress。在您发现后,我可以通过评论继续提供帮助。
      猜你喜欢
      • 2020-05-05
      • 2020-08-12
      • 2018-08-21
      • 1970-01-01
      • 2013-10-04
      • 1970-01-01
      • 2019-03-08
      • 2018-03-18
      • 1970-01-01
      相关资源
      最近更新 更多