Feb 08 2005

Better Spam Blocking

Published by at 1:26 pm under Site Work

This is an old article and the information contained within it may be out of date, not reflect my current views and/or contain broken links. If you feel this article is still valid and requires updating, you can use the contact form to let me know. However, I make no guarantee that it will get updated.

I’m upping the ante on Comment Spammers.

I’ve ben reading through the documentation for Apache and have come up with a better (I think) approach at blocking comment spammers. It may result in a few more people incorrectly receiving ASBOs but until I receive a complaint about it my new system ius staying in place.

The new system uses apaches mod_access and mod_setenvif to check if a referer has been set and block it if it conforms to a Regular Expression. The code that I have got in my .htaccess file is as follows:

SetEnvIf Referer ((holdem|texas|poker|casino|online|gambl|blackjack|game|free).*){2,} deny_me
Deny from env=deny_me

This is only a first version Regex and will probably need to be changed at some point, but it will do for now.

No responses yet