Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- Rewrite rule troubles


phpmaven - 1:44 pm on Jul 29, 2008 (gmt 0)


I have the following set of rules:

***********************
RewriteCond %{HTTP_user_agent} googlebot¦Msnbot¦Slurp [NC]
RewriteCond %{HTTP_user_agent} !AdsBot-Google [NC]
RewriteCond %{HTTP_HOST} !^www\.mydomain\.com [NC]
RewriteCond %{HTTP_HOST} !^mydomain\.com [NC]
RewriteCond %{HTTP_HOST} !^www\.mydm\.com [NC]
RewriteCond %{HTTP_HOST} !^mydm\.com [NC]
RewriteCond %{HTTP_HOST} .
RewriteRule ^.*$ [mydomain.com...] [L]
***********************

They work as I would expect except that they go into an infinite loop and I can't figure out why. Once the url gets rewritten the domain is www.mydomain.com and then the rules should be bypassed because the 3rd line would then be true and the rest shouldn't happen.

I'm sure I'm missing something obvious, but as usual I need your help Jim. FYI [mydomain.com...] is a non-existent page. I want to give the spiders a 404 if they request any from a domain other than the 4 I'm testing for.

Thanks,

Mark


Thread source:: http://www.webmasterworld.com/apache/3710219.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com