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
-
301 Redirects Showing As 307 Redirects
Hi, Our clients are adamant that they have set up 301 permanent redirects on their websites, but when we check using Screaming Frog and various online HTTP status code checkers they are showing as 307 temporary redirects. Examples;
Technical SEO | | Webpresence
http://www.lifestylelifts.co.uk/home-lifts/
http://www.terrylifts.co.uk/ Again, the client says they are seeing 301 redirects. Why are we seeing 307's? Who is right? Very puzzling, any theories would be very much appreciated 🙂 Thanks in advance. Lee.0 -
How best to fix 301 redirect problems
Hi all Wondering if anyone could help out with this one. Roger Bot crawler has just performed it's weekly error crawl on my site and I appear to have 18,613 temp redirect problems!! Rather, the same 1 problem 18,613 times. My site is a magento store and the errors it is giving me is due to the wishlist feature on the site. For example, it is trying to crawl links such as index.php/wishlist/index/add/product/29416/form_key/DBDSNAJOfP2YGgfW (which would normally add the item to one's wishlist). However, because Roger isn't logged into the website it means that all these requests are being sent to the login url with the page title of Please Enable Cookies. Would the best way to fix this be to enable wishlists for guests? I would rather not do that but cannot think of another way of fixing it. Any other Magento people come across this issue? Thanks, Carl
Technical SEO | | daedriccarl0 -
Migrating domains from a domain that will have new content.
We have a new url. The old url is being taken over by someone else. Is it possible to still have a successful redirect/migration strategy if we are redirect from our old domain, which is now being used by someone else. I see a big mess, but I'm being told we can redirect all the links to our old content (which is now used by someone else) to our new url. Thoughts? craziness? insanity? Or I'm just not getting it:)
Technical SEO | | CC_Dallas0 -
Site Penalized - 301 Redirect Question
Hello, We have a website that was penalized roughly two years by Google for "Unnatural Links"... We are experiencing a lot of problems with this site, completely unrelated to the penalty or SERPS, and we're debating doing a 301 Re-direct to another site we own that is totally clean and has no "Unnatural Links". If we do a 301 from the penalized site to our alternative website, will there be any cross-contamination? Will the penalty carry over to our other site? Please let me know what you guys think. Thanks
Technical SEO | | Prime850 -
Help creating a 301 redirect in my htaccess file
Hi Guys, I'm trying to build a 301 file with the file requirements: It should be visible only for Google and other Search Engine Agents. It will have a few direct redirects. A few URL must be dynamic redirect. For example each page the starts with olddomain.com/category and is not in the list of of direct redirects should be redirect for newdomain.com/category Here is my start point: #301 Starts here Set the agents RewriteEngine On
Technical SEO | | Felip3
RewriteCond %{HTTP_USER_AGENT} Googlebot [OR]
RewriteCond %{HTTP_USER_AGENT} msnbot [OR]
RewriteCond %{HTTP_USER_AGENT} Slurp Make the direct redirect. Redirect 301 /category/sub1 http://www.newdomain.com/category/sub1
Redirect 301 /category/sub2 http://www.newdomain.com/category/sub2 Redirect everything else Redirect 301 /category/* http://www.newdomain.com/category #End of my 301 Will that work how I want? is there anything wrong?0 -
.EDU via a 301 Redirect?
I recently received a link to my website from an .edu. However, the way they configured it was they pointed the link to one of their internal pages and then made that page 301 to my website. Is there anyway to gain any link juice from that sort of link?
Technical SEO | | gundogs0 -
When is it safe to remove 301 redirects?
I have created over 500 301 redirects in my .htaccess file, some of them are more than 2 years old now. Should I delete them? I don't like seeing the "notices" number in crawl diagnostics so high 😞
Technical SEO | | danielshaw0 -
Rel - canonical vs 301 redirect
I have multiple product pages on my site - what is better for rankings in your experiance? If I 301 the pages to 1 correct version of the product page - or if I rel caanonical to the one correct page?
Technical SEO | | DavidS-2820610