Best Approach to Redirect One Domain to Another
-
So I'm about to migrate one domain to another. Lets say I'm migrating boo.com to foo.com. Boo.com has good organic traffic & has some really well ranked pages. For this reason (I think) I want to send that traffic to some where other than the foo.com homepage. Perhaps a catered landing page. My question is can I redirect some of the specific pages on boo.com to a landing page on foo.com & then redirect the delta to foo.com's homepage? Or am a risking not fully transferring the full credit of one domain to another if I take that approach & therefore I should just redirect one domain to the other in its entirety?
Thanks,
Rich
-
Hi Rich,
Elaborating on FedeEinhorn’s answer, if the page structure is the same you could just redirect all requests to the same URI on your new domain, as he stated. You could do this very easily with a .htaccess file on the root folder of your old domain (providing you’re running an apache webserver like most people). To redirect using regular expressions and capture groups we can use the RedirectMatch directive, which would look like this:
RedirectMatch 301 ^(.*)$ http://www.newsite.com$1
As simple as that, you’ve redirected all existing pages to the same page on the new domain. If you haven't used this before, here's a brief look at how that works for you:
Firstly, RedirectMatch simply tells apache we’re using the RedirectMatch directive from mod_alias.
301 specifies a 301 SEO friendly redirect which passes all that lovely SEO juice to your new site.
^(.*)$ is our regular expression. It states, from the start of the requested URI (^) start capturing the request (using the brackets to show what we want to capture), capture it all (with . meaning any character or symbol and the * meaning 0 or more of the preceding . , which will lead to everything being caught by our capture group (the brackets). And the $ meaning the end of the requested URI.
The final part of this redirect is specifying the page to redirect to, but as we have captured the request in the previous part, we use $1 to append our first capture (only capture in this distance) to the end of our new domain.
If you have completely changed your site, you may wish to redirect all requests to your homepage or another page, it is as easy as modifying the previous code to redirect without appending our capture to the end of your redirection target, so this would be acceptable:
RedirectMatch 301 ^(.*)$ http://www.newsite.com
But since we don’t need to use anything from the requested URI, we should really remove the brackets (the capture group) for the sake of tidiness, resulting in:
RedirectMatch 301 ^.*$ http://www.newsite.com
You could use a mixture of these 2 code, for instance if your blog posts are all identical but your main site pages have all changed - this code would redirect all pages starting with /blog/ to their double on the new domain, but redirect all other pages to a /we-have-moved/ landing page:
RedirectMatch 301 ^(/blog/.*)$ http://www.newsite.com$1
RedirectMatch 301 ^.*$ http://www.newsite.com/we-have-moved/
Hope that's useful,
Tom
-
Hmm... my best guess is that if the content remains the same, that means that you have the same contents on boo.com and foo.com, then just simply do a page by page redirection, that will carry as many value as possible to the new pages.
However, you if you do not have the same pages available on both domains, then there are a couple of things you can do:
- Not the exact same content on the new domain: redirect to what you think is the best match.
- No similar content on the new domain:
- Option 1: Redirect to a page (sort of a landing page) showing similar pages that the user might be interested in.
- Option 2: Redirect to a landing page or homepage.
Hope that helps!
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
How Best to Handle Inherited 404s on Purchased Domain
We purchased a domain from another company and migrated our site over to it very successfully. However, we have one artifact of the original domain in that there was a page that was exploited by other sites on the web. This page allowed you to pass any URL to it and redirect to that URL (e.g. http://example.com/go/to/offsite_link.asp?GoURL=http://badactor.com/explicit_content). This page does not exist on our site so the results always go to a 404 on our site. However, we find that crawlers are still attempting to access these invalid pages. We have disavowed as many of the explicit sites as we can, but still some crawlers come looking for those links. We are considering blocking the redirect page in our robots.txt but we are concerned that the links will remain indexed but uncrawlable. What's the best way to pull these pages from search engines and never have them crawled again? UPDATE: Clarifying that what we're trying to do it get search engines to just never try to get to these pages. We feel the fact they're even wasting their time on getting a 404 is what we're trying to avoid. Is there any reason we shouldn't just block these in our robots.txt?
Intermediate & Advanced SEO | | russell_ms1 -
How best to handle partial domain move?
The scenario is this, we have a website eg: ABC.com where the content is in two language folders (en-us and en-gb). We have created a new brand with website XYZ.com for the USA market. Of course, this domain will take a while to rank because it is completely fresh. My question is how best to deactivate the en-us content on the old site to: a) prevent it showing up on Google US
Intermediate & Advanced SEO | | esseljay
and
b) pass the US traffic to the new website to boost its rankings I was thinking of removing the en-us pages from ABC.com and using a 410 error page containing a link to XYZ.com
Would it be better to replace the content on en-us instead (with a link)? I'm not keen to use a straight 301 redirect as sometimes we get traffic from other countries to the en-us content. Thanks in advance Mozzers 🙂0 -
One of my Friend's website Domain Authority is Reducing? What could be the reason?
Hello Guys, One of my friend's website domain authority is decreasing since they have moved their domain from HTTP to https.
Intermediate & Advanced SEO | | Max_
There is another problem that his blog is on subfolder with HTTP.
So, can you guys please tell me how to fix this issue and also it's losing some of the rankings like 2-5 positions down. Here is website URL: myfitfuel.in/
here is the blog URL: myfitfuel.in/mffblog/0 -
The Consequences & Best Practices In Changing Domains
Working with a long established/organic successful site that, for brand reasons I disagree with, is verging on changing its domain name. Other than 301ing individual pages to their new domain name equivalent, getting canonicals updated, updating SSL certificates, new Google Search Console with old settings, maintaining the old robots.txtetc what else is worth paying attention to? Assuming I do all of that, how bad a hit to organic over what period of time might this result in? 6 months ago we migrated to https and that was hardly felt, but this is really a brand new domain name altogether. Thanks!
Intermediate & Advanced SEO | | 945010 -
What happens when I redirect an entire site to an established page on another site?
Hi There, I have a website which is dedicated to selling ONE product (in different forms) or my main brand site. It is branded similarly, targets similar keywords, and gets some traffic which convert to leads. Additionally, the auxiliary site has a Google Rank 2 in its own right. I am thinking of consolidating this "auxillary" site to the specific product page on my main site. The reason I am considering doing this is to give a "boost" to the main product page on our main site which has many core keywords sitting with SERP ranking of between 11-20 (so not in first 10) Because this auxiliary site it gets traffic and leads in its own right, I don't want this to be to the detriment of my leads overall. Question is - if I 301 redirect the entire domain from my auxillary site to the equivalent product on my main site am I likely to see a large "boost" to that product page? (i.e. will I likely see my ranking rise from 11 - 20 significantly)
Intermediate & Advanced SEO | | love-seo-goodness0 -
One Web site many Domains
One of my client have about 12 domains related to his one web site .all domain name relevant to keywords .but doing seo for one target domain name.Now he ask what to with rest od domains plz advice and experts advices are highly appreciate..
Intermediate & Advanced SEO | | innofidelity0 -
Redirecting Existing Domains to My Main Site
Hi I have a main property related website featuring different countries around the world. I also have many different seperate country websites 20+. All keyword rich domains with a good 9 years+ domain age and PR3's with decent links and moz rankings and unique content. Many of the sites are very low Alexa rank now and receive little traffic. I don't have the time now to spend on each of the individual domains and am wanting to consolidate them and their PR juice to the corresponding country page of my main website. My question is - is it possible - will google see this as me trying to manipulate them and is my main site likely to suffer from any penalties or downgrading? Thanks for your input.
Intermediate & Advanced SEO | | freecall0 -
What is the best practice when a client is setting up multiple sites/domains
I have a client that is creating separate websites to be used for different purposes. What is the best practice here with regards to not looking spammy. i.e. do the domains need to registered with different companies? hosted on different servers, etc? Thanks in advance for your response.
Intermediate & Advanced SEO | | Dan-1718030