Skip to content

Instantly share code, notes, and snippets.

@muskie9
Created February 4, 2015 20:44
Show Gist options
  • Save muskie9/f173f60eafa113f2b4d5 to your computer and use it in GitHub Desktop.
Save muskie9/f173f60eafa113f2b4d5 to your computer and use it in GitHub Desktop.
This will take any page (i.e. http://olddomain.com/some-url-segment) and redirect it to a new domain (i.e. http://www.newdomain/some-url-segment)
RewriteCond %{HTTP_HOST} !newdomain.com$ [NC]
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [L,R=301]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment