AI Ban Hammer A blogger implemented a honeypot-based bot-blocking method adapted from Terence Eden's PHP/.htaccess "banhammer" script, using Apache's RewriteMap to log IP addresses of bots that request a robots.txt-disallowed /badplace/ directory and then serve them a 402 Payment Required response. The author abandoned the original PHP approach after roughly 24 hours — during which it caught a few bots, including one reporting itself as Meta-operated — citing PHP/Apache-PHP security exposure and concerns about DDoS and oversized .htaccess files. The author said ChatGPT was among the bots caught ignoring robots.txt, and noted robots.txt is "convention, rather than enforcement. I hate myself just a little bit for writing about AI. Generally I’m sick of the smallweb’s twin addictions of writing ‘blogging is great isn’t it’ posts and writing for or against fucking AI. That said, I’m going to, because its my blog and I liked this method I found of blocking some AI bots that behave badly. I’m plagiarising a lot of people here, so basically very little of this is my own work and I take no credit for it. I’ll try to give credit where I can, but please forgive me if I forget. Ideas initially started to form after reading the post on Terence’s site https://shkspr.mobi/blog/ about how he’d used a PHP script that robots.txt meant should never be executed. Should a bot ignore robots.txt then the script added its IP address to a .htaccess file to block any further requests and give a ‘402’ Payment Required as the standard HTTP web responses to not yet have a HTTP 469 ‘Fuck off Clanker’ response. Although I’m hoping for one soon. I implemented Terence’s solution https://shkspr.mobi/blog/2026/11/blunt-banhammer-blocks-basic-bots-ballistically/ with my own named folder and every so slightly modified PHP script and let it run for around 24 hours. It caught a few bots including something that was at least reporting itself to be Meta operated. As I’d not waited any significant time after updating robots.txt I can perhaps give Zuckerberg the benefit of the doubt here. After 24 hours I decided I didn’t like this solution. I don’t especially want PHP and Apache-PHP on my server after the last critical security holes cost me several days of pain at work and I could see problems with DDOS and huge .htaccess files, so started investigating alternatives. Anubis https://anubis.techaro.lol/ https://anubis.techaro.lol/ of course which acts as a proof of work test for bots or something like Iocaine https://iocaine.madhouse-project.org/ https://iocaine.madhouse-project.org/ which is more devious. I don’t especially want to play with the bots although it has some temptation , I just want to stop the things from stealing my intellectual property especially when I’ve expressly told them not to in robots.txt. I realise robots.txt is convention, rather than enforcement, but its very very irritating that actors including ChatGPT who I caught doing this decide to just ignore it so they can do whatever they like. A commentator on the same post of Terence’s called Armin Wolfermann came up with a way of configuring the Apache web server to basically write a log file of IP addresses that try to access a robots.txt forbidden directory then load that file back into Apache as a RewriteMap file so all requests coming from those IP addresses would then be blocked. I changed things ever-so slightly to keep the 402 Payment Required response simple because that amuses me more. So first, setup robots.txt to stop bots from trying to access a certain directory; User-agent: Disallow: /badplace/ Then configure Apache for my website to write out the IP addresses that ignore robots.txt and try to touch me in the the badplace; LogFormat "%h %{honeypot}e" honeypot logformat CustomLog "/var/place/to/log/things/mybadplacelog.txt" honeypot logformat env=honeypot SetEnvIf Request URI "/badplace/" honeypot=1 Then add rules for Apache to load the file in and do something extra to those requests; RewriteEngine on RewriteMap honeypot "txt:/var/place/to/log/things/mybadplacelog.txt" RewriteCond ${honeypot:%{REMOTE ADDR}|0} =1 RewriteRule ^ - R=402,E= honeypot,L If you’d just rather stop them with a 403 error; RewriteRule ^ - F,E= honeypot But if using 402 or other error code you can set your own special message; ErrorDocument 402 "No no no - you didn't say the magic words - no no no" To bait the hook and add the link to pages on my website I went back to Terence’s initial work. Include this HTML