aero
aero

Reputation: 69

How to Allow Only Google, MSN/Yahoo bot access in .htaccess

i need help to only allow Google bot and Yahoo/MSN bot access to my site through .htaccess. Any help greatly appreciated.

For Google i got, not sure if that is right... Allow from googlebot.com google.com google-analytics.com Satisfy Any

Upvotes: 3

Views: 2643

Answers (1)

ziesemer
ziesemer

Reputation: 28687

I think your reasons for doing this are probably questionable, but the only way to really do this is by the reported User-agent (a HTTP request header), not by domain - and the reported user-agent can easily be spoofed by anyone. (This is also usually controlled through a robots.txt, but is typically for the opposite purpose - restricting crawlers, not normal users.) The servers that Google and others use to crawl sites won't have the same names or IPs as the names you listed.

For Google, some additional and official details of this are available at http://support.google.com/webmasters/bin/answer.py?hl=en&answer=1061943 . Yahoo and MSN will have similar pages.

Upvotes: 2

Related Questions