Redirect old domain to new domain using .htaccess
Here's a quick snippet of code to keep around if you ever migrate from an old domain to a new domain.
Shown here is what I used to move yourdomain.com/oldstore to yourdomain.com/newstore:
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yourdomain.com/oldstore$ [OR]
RewriteCond %{HTTP_HOST} ^www.yourdomain.com/oldstore$ [OR]
RewriteCond %{HTTP_HOST} ^www.yourdomain.com/newstore$
RewriteRule (.*)$ http://yourdomain.com/newstore/$1 [R=301,L]
This not only redirects to yourdomain.com/newstore from yourdomain.com/oldstore but also bumps off the www. subdomain
- See more at:
http://whaaat.com/content/redirect-o....6ioSysBT.dpuf
Bookmarks