Created
July 24, 2009 11:33
-
-
Save DaveChild/154029 to your computer and use it in GitHub Desktop.
Redirect all GET and HEAD requests to new domain (only redirecting GET and HEAD because POST, PUT, DELETE etc to old domain is almost certainly automated spam - no genuine users should ever be posting to old domain if it's been completely redirected). Ser
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
RewriteCond %{REQUEST_METHOD} ^(GET|HEAD) [NC] # Only rewrite GET requests | |
RewriteCond %{HTTP_HOST} olddomain\.com [NC] | |
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [L,R=301] | |
RewriteCond %{HTTP_HOST} olddomain\.com [NC] # Otherwise block | |
RewriteRule ^(.*)$ - [F] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment