5 ms·
My favorite robots.txt entry is Disallow: /touch-this-and-die Where that is a script that instantly bans the IP on the server. You'd be amazed how many bad b
by ck2 15y ago
My favorite robots.txt entry is Disallow: /touch-this-and-die
Where that is a script that instantly bans the IP on the server.
You'd be amazed how many bad bots hit it.
- Swizec 15y agoThat is a brilliant idea! I should use that in all my robots.txt
- ck2 15y agoIf you want to take it to the next level, embed it as a microdot (single pixel) link somewhere on a side page, and use css to make it display:none;visibility:hidden;margin:-9999px; so that no human could possibly click on it. Because of robots.txt, no bot should touch that link. And because it's off the page and hidden, no human either. But you'll be amazed how much it's hit. But a warning: the problem with today's browsers is prefetching. You'd have to make sure you disallow it for prefetching too or you'll trap innocent humans using hyperactive browsers. This technique also will catch mass downloading plugins where they are saving your entire website from a browser plugin - but they can die too in my book. If you want to be nice, write the banlist to a file you clear out ever hour via cron or with a time check.
- _delirium 15y agoBut that'd also ban curious non-robot geeks. :(
- sjs 15y agoIt would be nice to leave a comment for humans in there. I understand why they don't, but yeah.
- ck2 15y agoHave the script clear out the list every other hour if you want to be nice and/or leave a text message on what just happened :-) Those warning signs about touching the third rail are there for a reason...
- run4yourlives 15y ago...who can't follow instructions. :-)
- quanticle 15y agoI've seen a slightly more sophisticated solution. /phaser/stun bans you for an hour. /phaser/kill bans your for a week.