Blocking Specific User Agents
I came across a situation recently where a site was getting hammered by a couple of different ip addresses. The one thing they had in common was that they were all using the same User Agent, VoilaBot in this case. Instead of blocking each IP using IPTables, the following was added to the .htaccess file:
If you want to ban multiple User Agents, you can do the following:
RewriteEngine onAny client with "Voilabot" in the User Agent now gets a forbidden page.
RewriteCond %{HTTP_USER_AGENT} VoilaBot
RewriteRule .* - [F,L]
If you want to ban multiple User Agents, you can do the following:
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} UserAgent1 [OR]
RewriteCond %{HTTP_USER_AGENT} UserAgent2
RewriteRule .* - [F,L]

Leave a comment