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
-
How do you 301 redirect URLs with a hashbang (#!) format? We just lost a ton of pagerank because we thought javascript redirect was the only way! But other sites have been able to do this – examples and details inside
Hi Moz, Here's more info on our problem, and thanks for reading! We’re trying to Create 301 redirects for 44 pages on site.com. We’re having trouble 301 redirecting these pages, possibly because they are AJAX and have hashbangs in the URLs. These are locations pages. The old locations URLs are in the following format: www.site.com/locations/#!new-york and the new URLs that we want to redirect to are in this format: www.site.com/locations/new-york We have not been able to create these redirects using Yoast WordPress SEO plugin v.1.5.3.2. The CMS is WordPress version 3.9.1 The reason we want to 301 redirect these pages is because we have created new pages to replace them, and we want to pass pagerank from the old pages to the new. A 301 redirect is the ideal way to pass pagerank. Examples of pages that are able to 301 redirect hashbang URLs include http://www.sherrilltree.com/Saddles#!Saddles and https://twitter.com/#!RobOusbey.
Intermediate & Advanced SEO | | DA20130 -
Php 301 redirect
Hi I am migrating an old wordpress site to a custom PHP site and the URL profiles will be different, so want to retain all link profiles and more importantly if a user visits the old urls via search then they are seamlessly transferred to the new equivalent page For example www.domain.com/about-us is going to need to redirect to www.domain.com/aboutus.php www.domain.com/furniture is going to need to redirect to www.domain.com/furniture-collections.php etc What is the best way of achieving this apart from .htaccess as not 100% confident of doing this. Could it be done via PHP or using meta tags?
Intermediate & Advanced SEO | | ocelot0 -
Should I redirect my Google Update Effected Domain to brand new Domain?
Hey Moz experts, I had a domain which was really doing better but after the Humming Bird update my traffic was decreased up to 90%. There are plenty of posts on my existing blog, Now what should I do? I mean should I redirect it to a brand new domain or Copy all the posts to a brand new domain and delete my existing domain? Note that the Old domain has PR1, DA 19 and PA 30.
Intermediate & Advanced SEO | | imran20780 -
Sub domain on root domain
Hello,
Intermediate & Advanced SEO | | dror999
I have a question that I can't find a good answer on.
I have a site, actually a "portal"/ "directory" for service providers.
Now, for start, we opened every service provider own page on our site, but now we get a lot of applications from those providers that thy want sites from their own.
We want to make every service provider his own site, but on sub domain url. ( they don’t mind… its ok for them)
So, my site is www.exaple.com
There site will be: provider.exaple.com
Now I have two questions:
1. can it harm my site in SEO?
2. if one from those sub domain , punished by google because is owner do "black hat seo" , how it will affect the rood domin? It can make the root domain to get punished?
Thanks!!0 -
Multiple domains?
I do own a domain for my business right now, and would have a few questions, regarding the increase or traffic for my website and getting new business 1. Is it worth to purchase multiple domains, keyword search relevant, to my business? 2. If so how is the best way to use it? : have them redirect to my own website? a specific type of redirect? do I make a separate website for each of them? 3. for ex if the keyword is " tile and grout". I figured would be best to own "tileandgrout.com". How about "tile-and-grout.com"? thank you in advance
Intermediate & Advanced SEO | | DavidIRC0 -
Explaining 301 redirects instead of 302
I am trying to explain in layman's terms to a client why using 302 for their redirects (which they have done themselves) is not right. There view is they do not seem to listen or believe what is being said to them and do not want to do permanent damage to the old domain so are using 302 redirects. I have explained over and over 301 is needed but I do not seem to be good at communicating this. Can someone give me a good example or description I can use to get my point across?
Intermediate & Advanced SEO | | JohnW-UK0 -
Redirect Help - Domain Change and Website Redesign
Hi there, I've redesigned a website for a client, but we are also changing domains and I'm trying to figure out the best way to set up the redirects from their old domain to the new one. 95% of their search engine traffic originally came through brand related keywords that landed on their homepage, and most of the remaining 15% landed on 3 other pages. The new site has pages to replace these 3 main SEO pages, and I'm about to set 301 redirects from their old domain, but I can't figure out the quickest/best way to do it. Is it possible to set up a specific redirect for the 4 main pages (Home + plus the 3 others) then a "catch all" type of thing for the rest of the pages, that redirect either to the homepage, or some sort of "Check out our new Site" landing page. How do you do this, or is there a better way to set it up? Thanks!
Intermediate & Advanced SEO | | timscullin0 -
301 Redirect With A Message And Delay
Hello, I'd like to sell a site I own. I'd like the site to be redirected to the buyers site with a 301 redirect. But I'd like the viewer to be informed that the site was purchased by this company and they will be redirect in 5 seconds.I'd like for the redirect to be a complete 301 and pass as much linklove as possible. Are you familiar with how to do this? Thanks, Tyler
Intermediate & Advanced SEO | | tylerfraser0