使用WWW前缀访问站点导致500内部服务器错误!

我已经迁移到一个新的服务器,当我尝试使用我的网站与www前缀我得到一个500内部服务器错误。 这个用法在我以前的主机上工作就好了。 这是htaccess文件的一个片段,它引用了www – 没有其他地方引用www。

<IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^blog/ - [L] RewriteCond %{HTTP_HOST} ^www\.mydomain\.com$ [NC] RewriteRule ^(.*)$ http://mydomain.com/$1 RewriteRule ^search/(.*)/(.*)/(.*)/(.*) /search.php?searchfor=$1&sortby=$2&page=$3&searchterm=$4 RewriteRule ^confirmemail/(.*) /confirmemail.php?code=$1 RewriteRule ^resetpassword/(.*) /resetpassword.php?code=$1 RewriteRule ^resendconfirmation/(.*) /resendconfirmation.php?userid=$1 RewriteRule ^categories/ /categories.php RewriteRule ^([-_~*a-zA-Z0-9]+)(\/)?$ /memberprofile.php?username=$1 RewriteRule ^browse/audios/(.*)/(.*)/(.*)/(.*) /audios.php?sortby=$1&filter=$2&page=$3&title=$4 RewriteRule ^browse/categories/audios/(.*)/(.*)/(.*)/(.*) /categoryaudios.php?sortby=$1&filter=$2&page=$3&title=$4 RewriteRule ^audios/(.*)/(.*) /playaudio.php?audioid=$1&title=$2 RewriteRule ^download/audio/(.*)/(.*) /downloadaudio.php?AUDIOID=$1&title=$2 RewriteRule ^members/audios/(.*)/(.*) /memberaudios.php?pid=$1&username=$2 RewriteRule ^syndicate/audios/(.*)/(.*) /syndicateaudios.php?filter=$1&title=$2 </IfModule> 

我还能检查什么?

我已经用Plesk控制面板设置了这个域 – 也许这是问题?

感谢所有的帮助

更新

错误日志显示,当我去我的网站使用www前缀。

[Wed Sep 08 13:57:24 2010] [error] [client xx.xxx.xx.xxx]由于可能的configuration错误,请求超过了10个内部redirect的限制。 如果需要,使用“LimitInternalRecursion”来增加限制。 使用“LogLeveldebugging”来获得回溯。

更新2

我的网站有一个服务器别名在forms serverAlias www.mydomain.com的httpd.conf文件 – 可以导致redirect循环?

更新3

我不能让Apache创build或写入重写日志,我不想做太多的服务重启,因为有人在使用该网站。

我已经添加了这个问题的赏金,因为我真的需要帮助!

这很有趣,因为日志声明redirect正在发生,但是你没有任何使用[R]标志的规则。 但是,当一个规则包含http:// …这个[R]标志是多余的,那么

 RewriteRule ^(.*)$ http://mydomain.com/$1 

规则是导致问题的可能候选人。

如果我是你,我会尝试在该行的末尾放置[R = 301,L],以确保其他规则不会以某种方式使用以前的主机名,从而导致循环。

另一种可能是PHP参与了redirect循环。 你可以通过Firefox和livehttpheaders插件访问www站点,并在这里分享标题? 这可能会说明导致redirect循环的原因。

我不认为Plesk涉及的事实与它有任何关系,不,我不认为ServerAlias与它有任何关系。 这只允许为两个虚拟主机提供相同的configuration:www.example.com和example.com。

希望有所帮助!

还有一个重写日志 ,激活它,看看会发生什么。

在大多数情况下,这是一个可重入的规则。

怎么样:

 <IfModule mod_rewrite.c> RewriteEngine On ReWriteCond %{HTTP_HOST} !^mydomain ReWriteRule ^(.*)$ http://mydomain.com/$1 ... </IfModule>