.htaccess - how to block all bot whose useragent does not contain alphabeth? -
i looking ways kill bots. found 1 interesting
http://www.allthingsdemocrat.com/block-bad-bots-in-htaccess.txt
well, @ code , blocks many ips.
then saw logs , see many have strange user agents these:
1.187.222.161 1.190.102.170 1.204.110.71 1.204.237.58 1.204.90.93 1.204.92.8 1.205.56.160 1.207.62.137 1.25.184.201 1.254.182.168 1.26.85.177 1.27.15.31 1.28.223.16 1.29.133.186 1.30.209.119 1.31.68.200 1.46.202.207 1.48.121.252 1.53.196.135 1.57.43.10 1.58.168.149 1.59.17.21
so user agent numbers. no alpha numeric.
i want block such user agent.
setenvifnocase user-agent "^192.comagent.*" bad_bot
for example block bot starting 192.comagent
how block bot doesn't contain alphabet
would do
setenvifnocase user-agent "!(([a-z]|[a-z]).+)" bad_bot
i wonder if it's correct?
basically combine [a-z]|[a-z] mean alphabet. ([a-z]|[a-z]).+ means contains @ least one. add ! see if not one.
will work?
Comments
Post a Comment