Use .htaccess to Block Yandex, Baidu, and MJ12bot
<p>I am so tired of Yandex, Baidu, and MJ12bot eating all my bandwidth. None of them even care about the useless robots.txt file.</p>

<p>I would also like to block any user-agent with the word "spider" in it.</p>

<p>I have been using the following code in my .htaccess file to look at the user-agent string and block them that way but it seems they still get through. Is this code correct? Is there a better way?</p>

<pre><code>BrowserMatchNoCase "baidu" bots
BrowserMatchNoCase "yandex" bots
BrowserMatchNoCase "spider" bots
BrowserMatchNoCase "mj12bot" bots

Order Allow,Deny
Allow from ALL
Deny from env=bots
</code></pre>