Skip to content

Instantly share code, notes, and snippets.

@fasterwp
Created June 11, 2018 19:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fasterwp/817ec59ece01ce7670ce609fcd50ddf8 to your computer and use it in GitHub Desktop.
Save fasterwp/817ec59ece01ce7670ce609fcd50ddf8 to your computer and use it in GitHub Desktop.
Redirect old domain to new domain in htaccess
RewriteEngine on
RewriteCond %{HTTP_HOST} ^olddomain.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.olddomain.com [NC]
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [L,R=301,NC]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment