If you are reading this, please get modern browser.
skip to main content | skip to main navigation | skip to secondary content

Don’t Wanna Pu*sy in My Stats

~ 16th July 2005. · 23:30 CET · permanent link · printer friendly ~

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.

2 Comments

  1. Great article. It was pointed out to me by a visitor to my site and a link to it has been added to our Resources page. Thanks!

  2. So this looks great but what is the difference between http and post?:

    SecFilterSelective “HTTP_REFERER” “(?????)”

    SecFilterSelective “POST_PAYLOAD” “(?????)”

Sorry, the comment form is closed at this time, but if you have anything to say, please send me a message.

* Please keep in mind that this is a personal web site and it does not reflect the position or opinion of my respective employers, organizations or partners.

Typetester – compare screen type Supported by Veer.

What is this?

A web log of Marko Dugonjić, web professional from Croatia. Topics covered:

Translate this site

German, Spanish, Italian, French or Japanese (via).

See you there!

Feel like buying a book?

Try with maratz.com aStore

Worth visiting

top of the page | skip to main content | skip to main navigation | skip to secondary content