2013-01-03 67 views
0

在我的Apache是​​error.log我得到這個錯誤的成千上萬:外部環路重定向

2013-01-02 20:46:44.582 [INFO] [50.18.21.225:48281-1#APVH_example.com] [REWRITE] 
    detect external loop redirection with target URL: /index.html, skip. 
2013-01-02 20:46:44.582 [INFO] [50.18.21.225:48276-1#APVH_example.com] [REWRITE] 
    detect external loop redirection with target URL: /index.html, skip. 

我有這樣的.htaccess文件:

<IfModule mod_rewrite.c> 
    RewriteEngine On 

    RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] 
    RewriteRule ^(.*)$ http://%1/$1 [R=301,L] 

    RewriteCond %{HTTP_USER_AGENT} "Somebot|Otherbot" [NC,OR] 
    RewriteCond %{HTTP_USER_AGENT} "Anotherbot" [NC] 
    RewriteCond %{REQUEST_URI} !(\/mypages|\/otherpages) [NC] 
    RewriteRule ^(.*)$ index.html? [R=301,L] 

    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteRule ^(.*)$ index.php [QSA,L] 
</IfModule> 

如果我註釋掉這個塊,我沒有得到任何錯誤。但是我需要這個爲mysite。

RewriteCond %{HTTP_USER_AGENT} "Somebot|Otherbot" [NC,OR] 
    RewriteCond %{HTTP_USER_AGENT} "Anotherbot" [NC] 
    RewriteCond %{REQUEST_URI} !(\/mypages|\/otherpages) [NC] 
    RewriteRule ^(.*)$ index.html? [R=301,L] 

回答

1

嘗試修改該塊是這樣的:

RewriteCond %{HTTP_USER_AGENT} "Somebot|Otherbot" [NC,OR] 
RewriteCond %{HTTP_USER_AGENT} "Anotherbot" [NC] 
RewriteCond %{REQUEST_URI} !(/mypages|/otherpages) [NC] 
RewriteCond %{REQUEST_URI} !index\.html 
RewriteRule ^(.*)$ index.html? [R=301,L]