I was telling a friend about the IP minefields I had implemented in various folders to keep snoopers out. I remember that I mentioned this at OSCON and other people had also mentioned that it was a great idea (that hadn’t been done before?). It is a good idea, and trivially easy to implement. So here’s the PHP source:
$deny = '# ' . date("D M j G:i:s T Y") . "
";
$deny .= 'Deny from ' . $_SERVER['REMOTE_ADDR'] . "
";
fwrite(fopen('.htaccess', 'a'),$deny);