Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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