Blocking Bots - Which method is best in htaccess?

Werombi

Registered Member
Joined
May 26, 2015
Messages
64
Reaction score
33
Hi All,
I have seen 2 methods of blocking bots through htaccess floating around and cannot see the operating difference.
Can someone please explain the difference?
If you know of what is best practice that be great too...
Im using wordpress themes if this make any difference.


First and currently using:
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^robot-name [NC,OR]
RewriteRule ^.* - [F,L]

Recently ive seen:
SetEnvIfNoCase User-Agent "^Enter User-Agent" bad_bot
SetEnvIfNoCase User-Agent "^Enter User-Agent" bad_bot
SetEnvIfNoCase User-Agent "^Enter User-Agent" bad_bot
SetEnvIfNoCase User-Agent "^Enter User-Agent" bad_bot

<Limit GET POST HEAD>
Order Allow,Deny
Allow from all
Deny from env=bad_bot
</Limit>
 
Back
Top