Skip to content

Instantly share code, notes, and snippets.

@ethangardner
Created October 20, 2015 16:35
Show Gist options
  • Save ethangardner/b8c97f4665c5d7976746 to your computer and use it in GitHub Desktop.
Save ethangardner/b8c97f4665c5d7976746 to your computer and use it in GitHub Desktop.
Redirect old domain to www version of a new domain
# BEGIN Redirects
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^olddomain\.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www\.olddomain\.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^newdomain\.com$ [NC]
RewriteRule (.*)$ http://www.newdomain.com/$1 [R=301,L]
</IfModule>
# END Redirects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment