Skip to content

Instantly share code, notes, and snippets.

@sewmyheadon
Created February 7, 2017 01:37
Show Gist options
  • Save sewmyheadon/988fbb1e367fb90d362058b2125399b6 to your computer and use it in GitHub Desktop.
Save sewmyheadon/988fbb1e367fb90d362058b2125399b6 to your computer and use it in GitHub Desktop.
Redirect all urls from an old domain to their corresponding location at a new domain.
# BEGIN HTTPS Redirect
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^old.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.old.com$
RewriteRule (.*)$ https://www.new.org/$1 [R=301,L]
</IfModule>
# END HTTPS Redirect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment