Activity Stream
48,167 MEMBERS
62651 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1.     
    #1
    Moderator
    NewEraCracker's Avatar

    Default Blocking spammers with mod_rewrite

    If you don't have APIs installed in your site that require POST method you can add this to .htaccess

    Code: 
    # Mitigate the spammers
    <IfModule rewrite_module>
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} ^$
    RewriteCond %{HTTP:Accept-Language} ^$
    RewriteCond %{REQUEST_METHOD} ^(POST)
    RewriteRule .* - [R=406]
    RewriteCond %{SERVER_PROTOCOL} ^(HTTP/1.0)
    RewriteCond %{REQUEST_METHOD} ^(POST)
    RewriteRule .* - [R=406]
    </IfModule>
    It blocks POST requests from all clients without referer header and without Accept-Language header (automated form submission) and blocks POST requests from any HTTP/1.0 client (bots don't need POST)

    -------

    If you use nginx as apache reverse proxy. It downgrades requests to HTTP/1.0 and you lose the original HTTP version so just use:
    Code: 
    # Mitigate the spammers
    <IfModule rewrite_module>
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} ^$
    RewriteCond %{HTTP:Accept-Language} ^$
    RewriteCond %{REQUEST_METHOD} ^(POST)
    RewriteRule .* - [R=406]
    </IfModule>
    Regards,
    NewEraCracker
    NewEraCracker Reviewed by NewEraCracker on . Blocking spammers with mod_rewrite If you don't have APIs installed in your site that require POST method you can add this to .htaccess # Mitigate the spammers <IfModule rewrite_module> RewriteEngine On RewriteCond %{HTTP_REFERER} ^$ RewriteCond %{HTTP:Accept-Language} ^$ RewriteCond %{REQUEST_METHOD} ^(POST) RewriteRule .* - RewriteCond %{SERVER_PROTOCOL} ^(HTTP/1.0) Rating: 5
    Trusted: Dom, l0calh0st, 0ccul7, robert420
    Find all threads started by NewEraCracker

  2.   Sponsored Links

  3.     
    #2
    Member
    Thanks for this NEC

  4.     
    #3
    Banned
    Website's:
    xsl.tel xsltel.com
    Thank you very much NEC

  5.     
    #4
    Member
    Website's:
    felonygames.com
    Try using this site . HERE
    Comes in handy when you need to quail spammers from certain countries

  6.     
    #5
    Moderator
    NewEraCracker's Avatar
    I have improved the checking. Shoudn't block legit requests without Referer Header
    Trusted: Dom, l0calh0st, 0ccul7, robert420
    Find all threads started by NewEraCracker

  7.     
    #6
    Banned
    Website's:
    CloudNXT.net
    LOL Most of site owners wont add it because only multiposters post on their site

  8.     
    #7
    Moderator
    NewEraCracker's Avatar
    You can allow multiposters by excluding the first set of rules and leaving this in .htaccess.
    Code: 
    <IfModule rewrite_module>
    RewriteEngine On
    RewriteCond %{SERVER_PROTOCOL} ^(HTTP/1.0)
    RewriteCond %{REQUEST_METHOD} ^(POST)
    RewriteRule .* - [R=406]
    </IfModule>
    This will still block spambots that rely in old libs that still use HTTP/1.0

    DON'T USE THIS, IF YOU USE NGINX!
    Trusted: Dom, l0calh0st, 0ccul7, robert420
    Find all threads started by NewEraCracker

  9.     
    #8
    Just a doubt, will this ban all the auto posters or some of them ?

    Edit : Learnt that it ll block most of the old ones.

  10.     
    #9
    Member
    Hey i used this but when i try to use any Ajax related work and try to move / prune any posts or even try to make new posts manually

    Its says

    406 Not Acceptable

    An appropriate representation of the requested resource /index.php could not be found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
    Any help ?? FYI I use IPB 3.1.4

    Tested few things it only occurs when you put last 3 lines

    <IfModule rewrite_module>
    RewriteEngine On
    RewriteCond %{SERVER_PROTOCOL} ^(HTTP/1.0)
    RewriteCond %{REQUEST_METHOD} ^(POST)
    RewriteRule .* - [R=406]
    </IfModule>
    Any solution ?

  11.     
    #10
    Member
    what if I use nginx?

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. mod_rewrite fix
    By fdls in forum Web Application/Script Support
    Replies: 4
    Last Post: 9th Sep 2011, 05:51 PM
  2. Mod_rewrite access???
    By SaBteCh in forum Server Management
    Replies: 6
    Last Post: 18th Dec 2010, 01:09 AM
  3. mod_rewrite help
    By Paul in forum Webmaster Resources
    Replies: 1
    Last Post: 23rd Mar 2010, 12:02 AM
  4. Do spammers understand that they're spammers?
    By narutoroot in forum General Discussion
    Replies: 18
    Last Post: 21st Nov 2009, 06:36 AM

Tags for this Thread

BE SOCIAL