Skip to content

Instantly share code, notes, and snippets.

Last active November 13, 2018 22:06
What would you like to do?
Redirect to new domain .htaccess
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} [NC]
RewriteRule ^(.*)$ https://new-domain/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^([^www].*)$
RewriteRule ^(.*)$ http://www.%1/$1 [L,R=301]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment