Hi Everyone,
I have the following mod_rewrite setup to block a few bots I don't want taking up bandwidth on my site. The first two entries work fine and I added a new entry for Baiduspider. Ithen did a graceful restart but I am still seeing requests coming through from Baiduspider. I see in this line in the apache log entry the userAgent is equaling to Mozilla/5.0 , is that my problem and if so is there a way to adjust the syntax to grab Baiduspider/2.0 ? Basically can I grab what is inside () or does HTTP_USER_AGENT only care about what is right after the = sign?
# Apache Config Entry
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^Googlebot/Nutch-1.0 [OR]
RewriteCond %{HTTP_USER_AGENT} ^MJ12bot [OR]
RewriteCond %{HTTP_USER_AGENT} ^Baiduspider/2.0 [OR]
RewriteRule ^.* - [F,L]
# Apache log file example.
userAgent=Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)
Thank You!