Page is a not externally linkable
- Marketing and Biz Dev
-- Cloaking
---- .htaccess doesn't work with googlebot any more


jdMorgan - 1:17 am on Jun 30, 2006 (gmt 0)


The reason that your code 'quit working' is that Googlebot changed its user-agent string some time ago to a "Mozilla compatible" format of "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"

Therefore, your start-anchored regular expressions pattern no longer matches their requests.

You could remove the start-anchor and use:

RewriteCond %{HTTP_USER_AGENT} Googlebot [OR]

-or the more specific-

RewriteCond %{HTTP_USER_AGENT} ^Mozilla/5\.0\ \(compatible;\ Googlebot/ [OR]

As others have stated, this won't fool a hand-check. But if index_txt.php is indeed a plain-text equivalent of your Flash page, no more, no less, then I wouldn't worry about it; Google is against cloaking with intent to deceive the user, not against user-agent-dependent content negotiation per se.

You might also want to make sure you send a 'Vary' header to warn network caches that you are serving user-agent-dependent content:

# Tell caches that page content changes depending on client user-agent
<FilesMatch "\.(html¦php)$">
Header set Vary: "User-Agent"
</FilesMatch>

Change the broken pipe "¦" character to a solid pipe before use; Posting on this board modifies that character.

Jim


Thread source:: http://www.webmasterworld.com/cloaking/882.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com