Created
November 2, 2011 16:44
-
-
Save everfluxx/1334166 to your computer and use it in GitHub Desktop.
mod_rewrite rule set to block major search engine crawlers sending POST requests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Prevent major search engine crawlers from sending POST requests ### | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{HTTP_USER_AGENT} Googlebot [OR] | |
RewriteCond %{HTTP_USER_AGENT} Slurp [OR] | |
RewriteCond %{HTTP_USER_AGENT} bingbot | |
RewriteCond %{REQUEST_METHOD} =POST | |
RewriteRule .* - [env=set_allow_header:true,R=405,L] | |
Header set Allow "GET, HEAD" env=set_allow_header | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment