Skip to content

Instantly share code, notes, and snippets.

@ru2fac
Last active November 13, 2018 22:06
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 ru2fac/11639f7642712a6174a22f3be1f4ff16 to your computer and use it in GitHub Desktop.
Save ru2fac/11639f7642712a6174a22f3be1f4ff16 to your computer and use it in GitHub Desktop.
Redirect to new domain .htaccess
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} old-domain.ru [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