NewEraCracker
Active Member
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)
-------
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,
NewEraCracker
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
Last edited: