Skip to content

Instantly share code, notes, and snippets.

@adamstac
Created February 28, 2014 05:56
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 adamstac/9266035 to your computer and use it in GitHub Desktop.
Save adamstac/9266035 to your computer and use it in GitHub Desktop.
.htaccess to 301 redirect an old domain to a new domain
RewriteEngine On
RewriteCond %{HTTP_HOST} ^olddomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.olddomain.com$
RewriteRule (.*)$ http://newdomain.com/$1 [R=301,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment