Hi everyone,
We're planning on switching our domain to a new one, and would like to redirect all our S9Y posts to the new domain.
Say I have this permalink structure:
http://www.a.com/blog/archives/permalink.html
I want to be able to redirect this to:
http://www.b.com/blog/archives/permalink.html
Is there an easy ReWriteRule for the .htaccess file to do this?
Thanks for reading!
Redirecting S9Y to a new domain
-
- Regular
- Posts: 765
- Joined: Tue Oct 17, 2006 2:36 pm
- Location: Vienna/Austria
- Contact:
Re: Redirecting S9Y to a new domain
Code: Select all
RewriteRule ^http://www.a.com/(.*) http://www.b.com/$1 [R,L]
Re: Redirecting S9Y to a new domain
Thanks for replying kleinerChemiker!
I have a follow-up question:
What if I were to put the .htaccess file under the "blog" folder instead of the root directory, what would the Rewriterule be then?
I have a follow-up question:
What if I were to put the .htaccess file under the "blog" folder instead of the root directory, what would the Rewriterule be then?
-
- Regular
- Posts: 765
- Joined: Tue Oct 17, 2006 2:36 pm
- Location: Vienna/Austria
- Contact:
Re: Redirecting S9Y to a new domain
if the old one and the new one uses "blog" as subfolder, you could use the same code. If not, only add the subloder like:
Code: Select all
RewriteRule ^http://www.a.com/blog/(.*) http://www.b.com/$1 [R,L]
Re: 301 redirects
Careful with redirects, too many 302 redirects can get you penalized on search engines, especially Google.
If the move is permanent then you should use permanent 301 redirects:
If the move is permanent then you should use permanent 301 redirects:
Code: Select all
RewriteRule ^(.*)$ http://www.b.com/$1 [R=301,L,QSA]
Melvin D. Nava
Venelogía
Venelogía