默认wordpress htaccess导致重定向循环

时间:2014-02-22 00:04:08

标签: wordpress .htaccess loops redirect cpanel

我的wordpress网站上有默认的wordpress htaccess。

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)$ wp/$1 [L]
RewriteRule . index.php [L]

我在服务器上使用cpanel,而wordpress安装在/ home / username / public_html中 出于某种原因,当我访问不存在的网站上的某个网站时,我得到内部服务器错误而不是404.

同样在日志中我收到此错误

 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

一段时间后我开始收到此错误

mod_fcgid: can't apply process slot for /usr/local/cpanel/cgi-sys/php5

最终会禁用我的网页,其中包含有关资源不足的消息。

我正在使用带有apache的whm / cpanel。谁知道如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

根据您为安装目录提供的路径,我假设您使用的是www.yousite.com的默认设置。 问题似乎是您对htaccess上安装的wordpress网站以及默认规则使用subdomain规则。

您应该尝试使用下面的默认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

您可以在此处看到用于某些类型的WP安装的不同htaccess配置。 http://codex.wordpress.org/htaccess

Wordpress有很多与htaccess一起使用的内部内容,所以我会尝试使用推荐的htaccess配置。

相关问题