Forum Moderators: phranque

Message Too Old, No Replies

Blocking bots with mod rewrite

         

superclown2

11:36 am on Jun 1, 2011 (gmt 0)



I get a lot of bots with both undefined browsers and operating systems. Can anyone please suggest a way of blocking these bots in .htaccess if both of those conditions are met? I know how to block undefined user agents using:

RewriteCond %{HTTP_USER_AGENT} ^-?$ [NC]
RewriteRule .* - [F,L]

but any ideas on how to block only if both browser and OS are undefined?

wilderness

12:30 pm on Jun 1, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



There's not a copy and paste solution for this.
Best your able to do is create complicated regex lines, which match the browser to the OS (many browsers either were not used with specific OS's and/or are not compatible with some OS's).

There are a few examples (although not extensive enough details to offer a copy and paste solution) of white-listing at Webmaster World.

user agents list [google.com]