I have a website, lets say www.domain.com
and my current blog is at www.domain.com/blog/
so my URLs are like www.domain.com/blog/recent-post/
now Im having a new wordpress installation to handle blog, and pointed a subdomian to it, so the blog now is blog.domain.com
I have lot of seo work dne forwww.domain.com/blog/
I dont want to miss that, and I want to redirect users visiting www.domain.com/blog/
to www.blog.domain.com/
and www.domain.com/blog/any-url/
to www.blog.domain.com/any-url/
can some one help in writing redirection rule for this?
2
Answers
Why do you want to change
domain.com/blog
toblog.domain.com
?This isn’t good for SEO, since the links do not have the same value for a directory that for a subdomain.
Better to have the blog in a folder that subdomain, since the authority will always go to main domain (
domain.com
).If in spite of @Cailbuig’s advice you still want to do this, what you’d need is
Start with R=302 and then when it works change to R=301. 301 reponses are cached by browsers, so they are hard to test.