Posted By

Orlandoo on 09/19/10


Tagged

htaccess


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

kubaitis


Block All Requests From User Agents


 / Published in: Apache
 

It's possible to block all unwanted user agents that might be potentially harmful or perhaps just to keep the server load as low as possible.

  1. #Block bad bots
  2. SetEnvIfNoCase user-Agent ^FrontPage [NC,OR]
  3. SetEnvIfNoCase user-Agent ^Java.* [NC,OR]
  4. SetEnvIfNoCase user-Agent ^Microsoft.URL [NC,OR]
  5. SetEnvIfNoCase user-Agent ^MSFrontPage [NC,OR]
  6. SetEnvIfNoCase user-Agent ^Offline.Explorer [NC,OR]
  7. SetEnvIfNoCase user-Agent ^[Ww]eb[Bb]andit [NC,OR]
  8. SetEnvIfNoCase user-Agent ^Zeus [NC]
  9. <limit get="" post="" head="">
  10. Order Allow,Deny
  11. Allow from all
  12. Deny from env=bad_bot
  13. </limit>

Report this snippet  

You need to login to post a comment.