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 Block Bad Bots htaccess, Block Proxy Servers Code For .htaccess and Cache htaccess Code To Speed Up Website.