I've read a lot about bad bot blocking, php scripts, .htaccess techniques, etc...

Is this a valid method?

Since .htacces can rewrite and send a bad bot a 403 deny or forward to something like spam poison, is it possible to Disallow a folder, then through .htaccess in that specific folder redirect to spampoison? Since Apache reads each .htaccess independently and follows specific instructions, then a bad bot not following robots.txt would just be redirected. Or anyone trying to access, /badbot/ or whatever I choose to call my trap folder.

  • 1
    You're basically describing a form of honeypot. The bot trap John references in the answer he linked to below is one particular implementation, but this is a more general term for the technique.
    – Su'
    Jul 1, 2012 at 3:49

3 Answers 3


I've recommended similar tactics before.


What you suggest (use a bot trap to trap the bad bod, and then block it using .htaccess or your favourite scripting language) is indeed a much-used technique for dealing with robots from the dark side.

You may want to look at another thread here about this particular technique: Tactics for dealing with misbehaving robots

If you're looking for sample code that tells you how to implement it, just Google for "bot trap". Here is just one such page: http://www.kloth.net/internet/bottrap.php that I found very instructive.


If the bots aren't changing IP's often why let them hit your server and take up usage? I would ban the IPs's first in hosts.deny / ipchains then use .htaccess and robots.txt as back up

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.