Handling Multiple Domain 301 Redirects on Single htaccess file
-
Hello,
I have a client that currently that has 9 different markets with different sub-domains on one server (aka one htaccess file.). All the sites have very similar Navigation and some of them contain the same products aka same URLs. The site is using Magento CMS and I'm trying to figure out how to redirect some products that have been removed from one of the stores. The problem I'm running into is when I try to redirect one store url, it redirects all the site's URLs.
Example
I'd like to redirect http://store.domain1.com/old-url.html to http://store.domain1.com/new-url.html without making http://store.domain2.com/old-url.html redirect.
I've literally been pulling out my hair trying to figure this one out but have had no luck. Does anybody have any ideas on how I could do this without having the sites redirect or create any loops?
Any wisdom from you apache experts would be greatly appreciated.
Thanks, Erik
-
Hi Erik,
How are you trying to do the redirect? Can you share the code? I'm not an .htaccess guru, but some of the guys here are.
-Andy
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
-
(Urgent) losing traffic after 301 redirect
We face a seo problem of losing traffic after 301 redirect.We have used 301 redirect from a sub-domain url to main domain, after a few month, we discovered that the traffic in google is dropped 40% as well as yahoo dropped 50% without reason, we have updated sitemap already, but we cannot find any reason for the traffic dropped till now..The original url (more then 5000 links)https://app.example.com/ebook Redirected Urlhttps://www.example.com/ebookThank you for your help!
Intermediate & Advanced SEO | | yukung0 -
One domain - Multiple servers
Can I have the root domain pointing to one server and other URLs on the domain pointing to another server without redirecting, domain masking or HTML masking? Dealing with an old site that is a mess. I want to avoid migrating the old website to the new environment. I want to work on a page by page and section by section basis, and whatever gets ready to go live I will release on the new server while keeping all other pages untouched and live on the old server. What are your recommendations?
Intermediate & Advanced SEO | | Joseph-Green-SEO0 -
Does removal of internal redirects(301) help in SEO
I am planning to completely remove 301 redirects manually by replacing such links with actual live pages/links. So there will be no redirects internally in the website. Will this boost our SEO efforts? Auto redirects will be there for incoming links to non-existing pages. Thanks, Satish
Intermediate & Advanced SEO | | vtmoz0 -
Clarification around 301 redirects.
I’ve come across numerous blogs recently that suggest that SEOs should NOT do bulk re-directs to a category page. This has come as something of a surprise (doh!!) and I feel like I should already know this. It does seem like there is lots disagreement here so I thought that I’d ask what people’s opinions were to make sure that I get my thinking straight. I've read all the main Moz blog posts on this topic and, although really useful, they've left me none the wiser around a few specific questions. Here’s some more detail about the situation. We’re currently consolidating a lot of content into a main blog, which will be the focal point of new blogs posts that are created. This is different to the past, where we tended to create separate blogs for different products on separate domains. I’m currently considering how we move content across from one the older blogs to this new blog (which will soon sit on a subfolder of our main domain). I have three (!) questions: 1) Could you confirm that doing bulk re-directs a category page is bad? I already know that doing them all to the homepage is an error. 2) Should I re-direct the home page of the old blog on a separate domain to the relevant category page on the new site? The category page is related, but does not cover the EXACT topic. The category page covers our replacement product offering. It I shouldn't do this, where should I re-direct the old blog domain to? 3) I’ve recommended that we set up 301 redirects on a one-to-one basis, redirecting each piece of content to its new location on the old site. What about content that has been earmarked for removal and for which there is no obvious alternative? My previous recommendation has been to re-direct these pages to the most relevant category page on the new blog. Would it be better to let this 404 or, as an alternative, create a custom 404 for the users on the new blog highlighting the new content that we offer? Any help would be appreciated 🙂
Intermediate & Advanced SEO | | RG_SEO0 -
301 Redirect Dilemma - Website redesign
Hi Guys, We are redesigning a clients ecommerce site. As part of the process, we're changing the URL structure to make it more friendly. I have put together a provisional 301 redirect plan but I'm not sure just how far I need to go with it. So far I have extract all the pages from the existing site that Google Webmaster Tools says have links pointing at them - this totals 93 pages. I have matched each page like for like to the new website structure. My next step was to pull the landing pages report from Google Analytics, I have extracted the pages that received entrances over the last 6 weeks. This totals 553, less the redirects I have already done and cleaning up some Google Translate pages I have circa 410 pages left. Many of these pages has more than 1 URL pointing to that page. I'm debating how important it is that that all of these remaining 410 pages have individual redirects set up for them one by one. I have to rule out regex because there is no pattern that makes sense given that I have already set up redirects for the first 93 pages that have external links. My question therefore is how important are 301 redirects on pages that have no external links and receive less than 10 entrances over a 6 week previous period? Do I need to 301 every single product on the old site to it's corresponding page on the new site? Also, I'm not sure how to treat pages that have mutliple URL's on the old site, the existing URL structure is such a mess that in some instances I have 5 URL's for one product page? I could feasibly create 5 seperate redirects but is this necessary? Also what about speed considerations, the server is going to have to load these redirects and it may slow the site down. I'm sitting at 100 odd so far. Any answers are most appreciated. Thanks Derek.
Intermediate & Advanced SEO | | pulseo0 -
Very Puzzled --- 301 ReDirects Did Not Work - Lost Rankings - Any Thoughts?
This one has us stumped and frustrated, hopefully someone out there in SEOMoz land can give us some thoughts and/or suggestions on what's going on and how to remedy. This is a follow-up to a post I made awhile back. Here is an excerpt from the original post -- We currently have 3 different versions of our State Business-for-Sale listings pages - the versions are: Version 1 -- Preferred Version (Links on Homepage www.businessbroker.net) http://www.businessbroker.net/State/Vermont-Businesses_For_Sale.aspx Title = Vermont Business for Sale Ads - Vermont Businesses for Sale & Business Brokers - Sell a Business on Business Broker (I realize the title needs work) Version 2: (Links on this page: http://www.businessbroker.net/listings/blistings.ihtml) URL Prior to 301 change --- http://www.businessbroker.net/Businesses_For_Sale-State-Vermont.aspx Title = Vermont Business for Sale | 120 Vermont Businesses for Sale | BusinessBroker.net Version 3: (Links on this page: http://www.businessbroker.net/businessesforsale.ihtml) URL Prior to 301 change --- http://www.businessbroker.net/listings/business_for_sale_vermont.ihtml Title = Vermont Businesses for Sale at BusinessBroker.net - Vermont Business for Sale While the page titles and meta data are a bit different, the bulk of the page content (which is the listings rendered) are identical. OK, so we decided to test this on 5 of our State pages - I will use VERMONT in this discussion. We did 301 ReDirects on Version 2 and Version 3 -- they now redirect to Version 1 - we did the redirects and also changed the URL's on the pages. Prior to the change, we were ranking for keywords like "Vermont Business for Sale" and some other similar keywords -- on 1st page of Google --- now, we have lost our rankings big time. Did we do something wrong? I thought when you did 301's the majority of link juice was supposed to be preserved (losing 10% or so) -- this didn't happen in our case. Any help on what we can do would be appreciated. We only did 5 States as a test and also noticed big drops for Maine as well. These were both states where VERSION 2 was the page that was showing up in SERPs. Thanks in advance for wading through this long post and any help you can provide!! Matt
Intermediate & Advanced SEO | | MWM37720 -
301 redirect or Robots.txt on an interstatial page
Hey guys, I have an affiliate tracking system that works like this : an affiliate puts up a certain code on his site, for example : www.domain.com/track/aff_id This url leads to a page where the hit is counted, analysed and then 302 redirects to my sales page with the affiliates ID in the url : www.mysalespage.com/?=aff_id. However, we've noticed recently that one affiliate seems to be ranking for our own name and the url google indexed was his tracking url (domain.com/track/aff_id). Which is strange because there is absolutely nothing on that page, its just an interstatial page so that our stats tracking software can properly filter hits. To remove the affiliate's url from showing up in the serps, I've come up with 2 solutions : 1 - Change the redirect to a 301 redirect on his track page. 2 - Change our robots.txt page to block all domain.com/track/ pages from being indexed. My question is : if I 301 redirect instead of 302, will I keep the affiliates from outranking me for my own name AND pass on link juice or should I simply block google from crawling the interstatial tracking pages?
Intermediate & Advanced SEO | | CrakJason0 -
301 - should I redirect entire domain or page for page?
Hi, We recently enabled a 301 on our domain from our old website to our new website. On the advice of fellow mozzer's we copied the old site exactly to the new domain, then did the 301 so that the sites are identical. Question is, should we be doing the 301 as a whole domain redirect, i.e. www.oldsite.com is now > www.newsite.com, or individually setting each page, i.e. www.oldsite.com/page1 is now www.newsite.com/page1 etc for each page in our site? Remembering that both old and new sites (for now) are identical copies. Also we set the 301 about 5 days ago and have verified its working but haven't seen a single change in rank either from the old site or new - is this because Google hasn't likely re-indexed yet? Thanks, Anthony
Intermediate & Advanced SEO | | Grenadi0