I want to block these bots from seeing my crawling my site.Which of these is the best and will not brick my site?
PHP Code:
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} rogerbot [OR]
RewriteCond %{HTTP_USER_AGENT} exabot [OR]
RewriteCond %{HTTP_USER_AGENT} mj12bot [OR]
RewriteCond %{HTTP_USER_AGENT} dotbot [OR]
RewriteCond %{HTTP_USER_AGENT} gigabot [OR]
RewriteCond %{HTTP_USER_AGENT} ahrefsbot [OR]
RewriteCond %{HTTP_USER_AGENT} sitebot
RewriteRule .* - [F]
PHP Code:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} ^rogerbot [OR]
RewriteCond %{HTTP_USER_AGENT} ^exabot [OR]
RewriteCond %{HTTP_USER_AGENT} ^MJ12bot [OR]
RewriteCond %{HTTP_USER_AGENT} ^dotbot [OR]
RewriteCond %{HTTP_USER_AGENT} ^gigabot [OR]
RewriteCond %{HTTP_USER_AGENT} ^AhrefsBot
RewriteRule ^.* - [F,L]
PHP Code:
SetEnvIfNoCase User-Agent .*rogerbot.* bad_bot
SetEnvIfNoCase User-Agent .*exabot.* bad_bot
SetEnvIfNoCase User-Agent .*mj12bot.* bad_bot
SetEnvIfNoCase User-Agent .*dotbot.* bad_bot
SetEnvIfNoCase User-Agent .*gigabot.* bad_bot
SetEnvIfNoCase User-Agent .*ahrefsbot.* bad_bot
SetEnvIfNoCase User-Agent .*sitebot.* bad_bot
<Limit GET POST HEAD>
Order Allow,Deny
Allow from all
Deny from env=bad_bot
</Limit>
Robin
Robin
Robin