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
-
To 301 or not to 301?
So, to cut a long story short, on our website we have a /product page that is very similar to our homepage and doesn't really serve much of a purpose. It doesn't really fit in with the rest of the website and our directors want to get rid of it and focus our efforts on our homepage. Problem is, the /product page has a little bit of PA and links to other important pages on the website. I personally don't want to completely cut this page off. Would a 301 redirect to the homepage be a good option or would I be better off redirecting users to our course library page (Our course pages are what bring in most of our organic traffic)? Any help or other suggestions would be appreciated here! http://www.ihasco.co.uk/
Technical SEO | | iHasco1 -
Spammers created bad links to old hacked domain, now redirected to our new domain. Advice?
My client had an old site hacked (let's call it "myolddomain.com") and the hackers created many links in other hacked sites with links such as http://myolddomain.com/styless.asp?jordan-12-taxi-kids-cheap-T8927.html The old myolddomain.com site was redirected to a different new site since then, but we still see over a thousand spam links showing up in the new site's Search Console 404 crawl errors report. Also, using the links: operator in google search, we see many results of spam links. Should we be worried about these bad links pointing to our old site and redirecting to 404s on the new site? What is the best recommendation to clean them up? Ignore? 410s? Other? I'm seeing conflicting advice out there. The old site is hosted by the client's previous web developer who doesn't want to clean anything up on their end without an ongoing hosting contract. So beyond turning redirects on or off, the client doesn't want to pay for any additional hosting. So we don't have much control over anything related to "myolddomain.com". 😞 Thanks in advance for any assistance!
Technical SEO | | usDragons0 -
301 Redirect
Hello Moz Community, I have a question regarding 301 redirecting a new domain that contains keywords relevant to my website. However, I do NOT want to change my current domain. My main question is, by just redirecting this new domain to my current website, will those keywords in the new domain help with ranking in anyway? Thanks in advance for any help!
Technical SEO | | WyzeOwl0 -
Best Place to Redirect 301 to?
Hey Everyone! I have an old site with hundreds of blog posts that are very spammy (duplicate content, keyword stuffed, and just plain bad content). I am going to redirect them and delete them from WordPress but I'm wondering where is the best place to redirect them to? Home page, other posts, other pages...? Any thoughts would be appreciated! Thanks!
Technical SEO | | adamxj21 -
301 Redirect with index.asp
I am very new to all of this so forgive the newbie questions I will get better. Ok so after starting a campaign I see that I have many issues including where some pages are being deemed as duplicate content. 1. The report says the http://lucid8.com has duplicate content on 2 other pages 2. When I look at them it shows that http://lucid8.com/index.asp and http://www.lucid8.com are duplicates. 3. Really these are the exactly the same page because the default page that is opened for www.lucid8.com http://www.lucid8.com etc always opens the index.asp page. 4. Now I read that I should do permanent redirects and how to do this via IIS and I tried to do a redirect from index.asp to www.lucid8.com but that does not work because www.lucid8.com is pointing to index.asp and so we end up in a circle. So the question is how do I get rid of these duplicate page references without causing problems. Thanks
Technical SEO | | TroyW0 -
301 redirect of a subdirectory
Hello! I am working on a website with the following structure: example.com/sub1/sub2/sub3. The page "example.com/sub1" does not exist (I know this is not the optimal architecture to have this be a nonexistent page). But someone might type that address, so I would like it to redirect it to example.com/sub1/sub2/sub3. I tried the following redirect: redirect 301 /sub1 http://example.com/sub1/sub2/sub3. But with this redirect in place, if I go to example.com/sub1, I get redirected to example.com/sub1/sub2/sub3/sub2/sub3 (the redirect just inserts extra subdirectories). If someone types "example.com/sub1" into a browser, I would "example.com/sub1/sub2/sub3" to come up. Is this possible? Thank you!
Technical SEO | | nyc-seo0 -
Redirect link from a particular domain
Hi guys/gals, I have a few domains and blogs which I use really for a bit of fun and experimenting. One of the domains (abc.com) wasn't doing much but has a few decent links built to it. I redirected this domain to an active blog (123.com). Here's the problem: There's a particular external link to the homepage of abc.com which drives a lot of traffic but isn't relevant to the content of 123.com which it redirects to, causing a huge bounce rate from this link. Is there a way (maybe using using htaccess) that I can redirect traffic from this one link to another domain completely? I've contacted the owner of the external site but they are unable (or unwilling) to change the link. I hope I haven't lost you all but shout if you need any clarification. Thanks in advance!
Technical SEO | | Confetti_Wedding0 -
301 redirect while keeping OLD domain for branding
Say you have CharityName.com. They use a dedicated domain name CharityNameEvent.com to advertise their main event. They use this domain on posters, flyers,etc and want to keep using it because it's easier to remember. CharityNameEvent.com has far, far more inbound links than CharityName.com (about 8 times more). Current problem: their current web developer has put the SAME content on both websites instead of setting up a redirect from CharityNameEvent.com (easy to remember) to CharityName.com/Event which would have made more sense. My intention is to consolidate the 2 websites and make sure CharityName.com benefits from links to the Event. I plan to move and 301 redirect CharityNameEvent.com to CharityName.com/Event. I know this would keep links and PR intact but I have a couple of questions: 1. Is it enough to set up the 301 redirect or would they have to ask websites to ACTUALLY change the links to CharityName.com/Event? 2. They plan and need to keep using CharityNameEvent.com for its ease of use on posters, flyers, etc. The 301 redirect would be in place. Would this cause any problems with search engines, especially when/if some people STILL link to CharityNameEvent.com instead of CharityName.com/Event? Basically, my understanding of 301 redirects is that they're used when a website permanently moves. In this case, the OLD DOMAIN name would still be used for reasons mentioned above but would be 301 redirected to CharityName.com/Event. Any chance this might not maximise the potential of new/old links? Any other way to go about it? Anything I'm missing with this scenario? Thanks
Technical SEO | | carmenmardiros0