iEntry 10th Anniversary RSS Newsletter Advertising
Join the WebProWorld Forum!
Text: Decrease Font Size Increase Font Size | Print Print Article | Share: Delicious Digg StumbleUpon Post to Twitter Post to Facebook
CommentSaturday, January 8, 2005

Using mod_rewrite against stupid comment spam bots...

You'd think the comment spammers would be a bit smarter, but apparently not. Over 80% of all attempted spam hits on my site provide no HTTP Referer data.

None of them work, of course, because my MT install isn't quite what they think it is (they don't know to type "jeremy" in the extra field). But it still takes up a bit of CPU effort to ask cgiwrap to fire up mt-comments.cgi and whatnot.

So I finally did what I've been meaning to do for a while now:

    RewriteCond %{HTTP_REFERER} ^$
    RewriteCond %{REQUEST_METHOD} ^POST$
    RewriteRule ^/mt/mt-comments.cgi - [F]

And 20 seconds after I did an apachectl graceful it blocked an attempt.

Morons, I tell you.
See Also

  • the mod_rewrite docs
  • Ralf's Apache 1.3 URL Rewriting Guide
  • Kasia's Spam breeds more spam
  • Jeremy Zawodny is the author of the popular Jeremy Zawodny's blog. Jeremy is part of the Yahoo search team and frequently posts in the Yahoo! Search blog as well.

    Visit Jeremy's blog: Jeremy Zawodny's blog.

    News Tags: Search, Yahoo, Spam, bots, Docs, Apache, Guide, blog, URL
    About the author:
    Jeremy Zawodny is the author of the popular Jeremy Zawodny's blog. Jeremy is part of the Yahoo search team and frequently posts in the Yahoo! Search blog as well.

    Visit Jeremy's blog: Jeremy Zawodny's blog.

    Publish A Comment

    The content of this field is kept private and will not be shown publicly.
    • Web page addresses and e-mail addresses turn into links automatically.
    • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
    • Lines and paragraphs break automatically.
    CAPTCHA
    This question is for testing whether you are a human visitor and to prevent automated spam submissions.
    1 + 12 =
    Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.
    SEARCH
    Popular WPN Business Resources












    Subscribe to WebProNews


    Send me relevant info