Printable Version of Topic

Click here to view this topic in its original format

Web Design Seo Forum _ Htaccess Guides _ Allow Only Googlebot Htaccess Code

Posted by: Web Design Seo Feb 8 2013, 11:44 AM

If you want to allow only google bot on your website, place this code exactly after "RewriteEngine On" in your htaccess file. This code can be used when server have huge server load and you need to limit load.

Код
RewriteCond %{HTTP_USER_AGENT} ^(.*)msnbot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(.*)MJ12bot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(.*)SolomonoBot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(.*)Yandex [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(.*)bingbot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(.*)Baiduspider [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(.*)Yeti [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(.*)Mail.Ru [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(.*)exabot [NC]
RewriteRule .* - [F]


Make this only you know what you do it!
In this way, you will allow only google bots to index your website. Website will be not indexed from bots of Baidu, Bing, Yandex and others big search engines.

If you need to limit load, will be good to use also http://3dwebdesign.org/forum/how-to-block-bad-bots-on-my-website-htaccess-code-t436, http://3dwebdesign.org/forum/how-to-block-proxy-servers-on-my-site-code-for-htaccess-t437 and http://3dwebdesign.org/forum/how-to-speed-up-website-htaccess-code-t425.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)