Blocking based on User-Agent Header

Submitted by:J Kamy81

Date added:16 January, 2019

Category:Apache

Apache Code example for blocking based on User-Agent Header

Tags: header , user agent , block

Code Snippet:

SetEnvIfNoCase ^User-Agent$ .*(craftbot|download|extract|stripper|sucker|ninja|clshttp|webspider|leacher|collector|grabber|webpictures) HTTP_SAFE_BADBOT
SetEnvIfNoCase ^User-Agent$ .*(libwww-example_com_spiderman) HTTP_SAFE_BADBOT
Deny from env=HTTP_SAFE_BADBOT
 
 

Comments