Don’t Wanna Pu*sy in My Stats
All right, two posts today, so what? Just checked my referrer stats and found all kind of pu*sies all over the list. There is black pu*sy, red pu*sy, smelly pu*sy… If you’re sick of all this referrer spam, that can be fixed with a simple .htaccess
directive:
<IfModule mod_security.c> SecFilterEngine On SecFilterScanPOST On SecFilterDefaultAction "deny,status:412" SecFilterSelective "HTTP_REFERER" "(undesired keyword|undesired keyword|undesired keyword)" SecFilterSelective "POST_PAYLOAD" "(undesired keyword|undesired keyword|undesired keyword)" </IfModule>
Listed keywords should be separated with a pipe (|) character.
Check with your host (run phpinfo()
on your server) if it supports mod_security
, even though most of them do. This should help you get rid of referrer spam as well as comment spam (for the specified keywords at least). If you want to know more (and I know you want), feel free to ride off to Introducing mod_security article.