Results 1 to 10 of 12
-
20th May 2011, 02:02 PM #1
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
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)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>
-------
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:
Regards,Code:# Mitigate the spammers <IfModule rewrite_module> RewriteEngine On RewriteCond %{HTTP_REFERER} ^$ RewriteCond %{HTTP:Accept-Language} ^$ RewriteCond %{REQUEST_METHOD} ^(POST) RewriteRule .* - [R=406] </IfModule>
NewEraCrackerNewEraCracker 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: 5Trusted: Dom, l0calh0st, 0ccul7, robert420
Find all threads started by NewEraCracker
-
20th May 2011, 02:05 PM #2
MemberThanks for this NEC

-
20th May 2011, 03:22 PM #3
BannedWebsite's:
xsl.tel xsltel.comThank you very much NEC
-
20th May 2011, 06:43 PM #4
MemberWebsite's:
felonygames.comTry using this site . HERE
Comes in handy when you need to quail spammers from certain countries
-
20th May 2011, 07:04 PM #5
I have improved the checking. Shoudn't block legit requests without Referer Header
Trusted: Dom, l0calh0st, 0ccul7, robert420
Find all threads started by NewEraCracker
-
21st May 2011, 07:32 PM #6
BannedWebsite's:
CloudNXT.netLOL Most of site owners wont add it because only multiposters post on their site
-
21st May 2011, 07:35 PM #7
You can allow multiposters by excluding the first set of rules and leaving this in .htaccess.
This will still block spambots that rely in old libs that still use HTTP/1.0Code:<IfModule rewrite_module> RewriteEngine On RewriteCond %{SERVER_PROTOCOL} ^(HTTP/1.0) RewriteCond %{REQUEST_METHOD} ^(POST) RewriteRule .* - [R=406] </IfModule>
DON'T USE THIS, IF YOU USE NGINX!Trusted: Dom, l0calh0st, 0ccul7, robert420
Find all threads started by NewEraCracker
-
16th Jun 2011, 03:00 AM #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.
-
21st Aug 2011, 06:26 PM #9
MemberHey 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
Any help ?? FYI I use IPB 3.1.4406 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.
Tested few things it only occurs when you put last 3 lines
Any solution ?<IfModule rewrite_module>
RewriteEngine On
RewriteCond %{SERVER_PROTOCOL} ^(HTTP/1.0)
RewriteCond %{REQUEST_METHOD} ^(POST)
RewriteRule .* - [R=406]
</IfModule>
-
2nd Sep 2011, 12:54 AM #10
Memberwhat if I use nginx?
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
mod_rewrite fix
By fdls in forum Web Application/Script SupportReplies: 4Last Post: 9th Sep 2011, 05:51 PM -
Mod_rewrite access???
By SaBteCh in forum Server ManagementReplies: 6Last Post: 18th Dec 2010, 01:09 AM -
mod_rewrite help
By Paul in forum Webmaster ResourcesReplies: 1Last Post: 23rd Mar 2010, 12:02 AM -
Do spammers understand that they're spammers?
By narutoroot in forum General DiscussionReplies: 18Last Post: 21st Nov 2009, 06:36 AM









Register To Reply

Staff Online
themaCreator - create posts from...
Version 3.55 released. Open older version (or...