Skip to content

Instantly share code, notes, and snippets.

@walkergv
Created February 9, 2015 18:14
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 walkergv/38f3a3fc1de4570ca720 to your computer and use it in GitHub Desktop.
Save walkergv/38f3a3fc1de4570ca720 to your computer and use it in GitHub Desktop.
Redirect old domain to a new domain in .htaccess file
## Gets an the old domain and any sub page and redirects it to the new domain and any path after the hostname.
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^olddomain.com$
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment