Answer the question
In order to leave comments, you need to log in
How to solve with iptables and User-Agent?
Need to kick some bots by user-agent.
I do for example:
iptables -A INPUT -p tcp --dport 80 -m string --algo bm --string "Mozilla/5.0 (compatible; MJ12bot/v1.4.5; http://www.majestic12.co.uk/bot.php?+)" -j DROP
Answer the question
In order to leave comments, you need to log in
Try .htaccess
SetEnvIf User-Agent "Mozilla/5.0 (compatible; MJ12bot/v1.4.5; http://www.majestic12.co.uk/bot.php?+)" BlockBot
Order allow,deny
Deny from env=BlockBot
Allow from all
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question