Forum Moderators: phranque
I have domain A and just bought domain B and now domain B point to everything in domain A, and when you type domain B, it goes redirects to domain A, but it stays written domain B in the url..
So all i want is that the url changes to domain A as well, so how I think it should be done in .htaacess, so can someone tell me its code?
Thanks in advance
That will cover the whole site.
You may also need to check that the 'receiving' domain has a user-friendly 404 page with appropriate navigation (and maybe a search box).
Plus you'll need:
301 domain-a.com to www.domain-b.com
301 domain-b.com to www.domain-b.com
301 www.domain-b.com/index.html to www.domain-b.com
(alter details to taste!).
You do not need individual page forwards, provided content is in the same folders etc., and it's obviously much less work if you can get away with that.
Where you do need to ensure people go from page-a at the old site to page-b at the new, let them be forwarded by the 'site 301', then 301 from page-a to page-b within the new site.
When merging two sites, there can be a problem of two pages with the same name in the same folder; best to delay the main move until you can ensure there's no duplication in the separate sites, if you can wait a few weeks for Google to assimilate essential navigation changes within each site.
Well the purpose was directing the misspelled domain to the original one!
So this did it:
rewritecond %{http_host} ^([a-z]+\.com) [NC]
RewriteRule (.*) [%1...] [R=301,L]
rewritecond %{http_host} ^(www.misspelled_domain\.com) [NC]
RewriteRule (.*) [original_domain.com...] [R=301,L]
First 2 lines redirects non-www to www
Second 2 lines redirects misspelled to original
Looks good? or is there a better way?