Skip to content

Instantly share code, notes, and snippets.

@sangar82
Created January 22, 2013 07:46
Show Gist options
  • Save sangar82/4592836 to your computer and use it in GitHub Desktop.
Save sangar82/4592836 to your computer and use it in GitHub Desktop.
.htacess snippet - Redirect with the query string all the pages with 301 redirection to new domain and redirects
RewriteEngine On
RewriteCond %{HTTP_HOST} ^old_domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.old_domain.com$
RewriteRule (.*)$ http://www.new_domain.com/$1 [R=301,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment