301 Redirect for 3 Domains into 1 New Domain
-
So I wanted a quick sanity check on the htaccess syntax for migrating 3 domains into 1 new domain. For example, we're migrating 3 sites abc.com, def.com and ghi.com, all into 1 new site on ghi.com.
Here's the htaccess we're placing on the root of ghi.com:
redirect 301 http://www.abc.com/wines.html http://www.ghi.com/wines redirect 301 http://www.def.com/trade.html http://www.ghi.com/trade
redirect 301 http://www.ghi.com/winery-tours.html http://www.ghi.com/visit/tasteOn the DNS side of things, we're parking abc.com and def.com on the ghi.com server.
I'm not seeing examples of htaccess files for this scenario, and none that use any domain info on the "from" side of the redirect 301 syntax. Any suggestions before we pull the trigger?
Thanks!
-
If I understand your question, you cannot redirect abc.com URLs from an htaccess file on ghi.com. That directive has to be placed on abc.com's htaccess file.
So the abc.com htaccess would show the specific redirects to ghi, ie:
redirect 301 /wines.html http://www.ghi.com/wines
def.com would also have an htaccess with redirects for each landing page:
redirect 301 /trade.html http://www.ghi.com/trade
ghi.com would not need any redirects since thats the site you want people to land on.
Unless you want all urls on abc.com to simply redirect to the root www.ghi.com, you have to write a redirect for every page you want to redirect (or use advanced code to rewrite every landing page to the new domain).
-
Please try this
I assume every old site has 3 different .htaccess files
Put Following codes in .htaccess of http://www.abc.com
Options -Indexes RewriteEngine onOptions +FollowSymLinks RewriteRule ^/wines.html _ _ http://www.ghi.com/wines[L,R=301]
Put Following codes in .htaccess of http://www.def.com
Options -Indexes RewriteEngine onOptions +FollowSymLinks
RewriteRule ^__/trade.html_ _http://www.ghi.com/trade [L,R=301]Put Following codes in .htaccess of http://www.ghi.com Options -Indexes RewriteEngine on__Options +FollowSymLinks RewriteRule ^_/winery-tours.html _ _http://www.ghi.com/visit/taste _ [L,R=301]
It should work. Clear browser history & check.
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
-
Strange URL redirecting to my new site
Hi all, I recently relaunched a site on a brand new URL - www.boardwarehouse.co.uk. I've spent the last couple of weeks building some backlinks as well as developing a basic content strategy. We've started ranking for a few of our less competitive keywords which is great, however there's a strange site which either redirects or is mirroring our content. I'm at a complete loss as to what's causing this to happen and what i can do to stop it. On the attachment - my content is top and second. The fourth result is the offending site. Any help/ advice would be most helpful! Thanks in advance, Alick 0BSyNn6
Technical SEO | | Alick3000 -
Should I consolidate multiple domains to a single site with 301 redirects?
Our client wants all his sites to be re-designed and perhaps consolidated into one domain. What are the dangers of using 301s on all his already ranking and established domains to their new forward-slash location? If there are some good articles that describe this exact issue please post a link.
Technical SEO | | dsmdesign0 -
What would happen if 301 redirects were not in place
Good Morning from 14 degrees C sunny Wetherby UK 🙂 My question is please.... "When a new site is given a total makover ie old urls are re written to radically different ones I know if you dont set up 301 redirects the infamous 404 error page will rear its head. But i wonder if 301 redirects were not configured how long on average does it take google to index the new site and serp links finally point to the new site". Thanks in advance 🙂
Technical SEO | | Nightwing0 -
Should I change a 301 redirect?
I recently moved all the content from an old site to a new site on a new domain. I lost a significant amount of traffic as a result. There are 301 redirects for every page on the old site. Generally, these point to the same content as was on the relevant page of the old site. However, the 301 redirect for the homepage on the old site points to the homepage on the new site, not to the content from the old site homepage. I'm wondering whether to change the 301 to point at the content from the old site homepage. Any advice would be much appreciated.
Technical SEO | | seqal0 -
How can I redirect old URLs to new ones?
We are trying to optimize our website for search engines and one of the things we have noticed that needs to be changed are the URLs. I know how to modify the URLs but have no idea how I can get the old redirected to the new ones using 301. We have some pages ranking pretty high on Google and we can't loose this traffic. Our website is hosted on Plesk and it was coded using Cold Fusion. I do have access to the .htaccess file. Any help would be highly appreciated.
Technical SEO | | personalproducts0 -
Where does Wordpress store the 301 redirects?
Hi, I've just created a campaign for my new wordpress blog and found 11 301 redirects which I was not aware of. It looks like wordpress has created them automatically. Does any one know how wordpress handles this issues or where are they stored so I can delete them? They are of no use for me. 9 of these redirects point to the same url with an added '/' and are in pages 1 is on a post. I've been changing the permalink and some urls several times and maybe one of these times the Wordpress has automatically created the 301 redirect. But why? I do not want to keep the old url. the last redirect is very strange it goes from http://www.mydomain.com/folder to http://www.mydomain.com where folder is the folder where I installed wordpress. But again, I want no one to type the url with the folder name or even know this folder exists. Any comment on this would be greatly appreciated. Thanks a lot, David
Technical SEO | | dballari0 -
301 redirect dropped page rank
Hi, We have a www domain that I have changed to a non www domain. The www domain had been in place for some time and had a good page rank, PR4. After this change the page rank dropped significantly (PR0, and now recently back to PR2) despite it being a 301 redirect which I thought "should" carry over the page rank. Yes, I am aware I should have just left it be. Hind sight 20/20 .. ya ya ya 🙂 My questions Is the 301 the correct method for this? Why did the page rank drop despite the 301? Should we go back to the www domain at this point? Thanks Kris
Technical SEO | | adriot0 -
Will Google index a 301 redirect for a new site?
So here is the problem... We have setup a 301redirect for our clients website. When you search the clients name it comes up with the old .co.uk website. We have made this redirect to the new .com website. However on the SERPs when it shows the .co.uk it shows the old title pages which currently say 'Holding Page'. When you click on that link it takes you to the fully functioning .com website. My question is, will the title tags in the SERPs which show the .co.uk update to the new ones from the .com? I'm thinking it will be just a case of Google catching up on things and it will sort itself out eventually. If anyone could help I would REALLY appreciate it. Thanks Chris
Technical SEO | | Weerdboil0