Jump to content
xisto Community
imjjss

Kill Spammers Before They Arrive .htaccess method

Recommended Posts

Recently, I encounted serious spammer attacking. They came like water fall, registering every minute, never stop. I had to install a humanity protection plugin. This plug in efficiently blocked the spammers. But the problem didn't end there-- the spammers kept trying to register. Every registering activity requires the register page from server, at the end, it cost me 3000mb bandwidth per month. A small site with limited resources like mine, this is a lot, and my site really got slower and slower. So, I searched around and found this little code to kill them permenently, before they comsume my bandwidth. Here's the code:

# BEGIN ANTISPAMBLOG REGISTRATIONRewriteEngine OnRewriteCond %{REQUEST_METHOD} POSTRewriteCond %{REQUEST_URI} .your-signup-page.php*RewriteCond %{HTTP_REFERER} !.your-domain. [OR]RewriteCond %{HTTP_USER_AGENT} ^$RewriteRule (.*) [url="http://forums.xisto.com/no_longer_exists/; [R=301,L]
Put this code in your .htaccess file.

Change "your-signup-page.php" to your signup page slug. For example, if your signup page is http://forums.xisto.com/no_longer_exists/, then, change it to "register.php". if your signup page is http://forums.xisto.com/no_longer_exists/, then, change it to "register"

Change "your-domain" to the domain of your blog.

Optionally, change "die-spammers.com" to whatever page you wish to send the spammers.

 

What does this code do?

It detect any POST requests (submitting a form) for your signup page, that haven’t been referred by any of your other pages, or have an empty user agent string (identifying the software making the request), and sends them to endless hell.

 

This code finally solved my problem. From the log, I can see the requirsts from spammers for my register page gets 0 bytes loaded, bandwidth saved. Spammers loss the war.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.