Htaccess 301s to 3 different sites
-
Hi,
I'm an htaccess newbie, and I have to redirect and split traffic to three new domains from site A.
The original home page has most of the inbound links so I've set up a 301 that goes to site B, the new corporate domain.
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]Brand websites C and D need 301s for their folders in site A but I have no idea how to write that in relationship to the first redirect, which really is about the home page, contact and only a few other pages.
The urls are duplicates except for the new domain names. They're all on Linux..Site A is about 150 pages, should I write it by page, or can I do some kind of catch all (the first 301) plus the two folders?
I'd really appreciate any insight you have and especially if you can show me how to write it.
Thanks
-
You are most welcome! Appreciate your feedback that it worked!
-
Yannick, it worked like a charm to all three new sites. Great info, thank you for taking the time to help me out.
-
You're welcome! Hope everything works out!
Test a few URL's first. Or even better: setup a small test case to make sure it works!
-
Greatness. Thanks!
-
RedirectMatch 301 /subdirectoryA/(.*) http://www.websiteB.com/$1
and
RedirectMatch 301 /subdirectoryB/(.*) http://www.websiteC.com/$1
Otherwise it wont work
About the htaccess from the old site... As long as Website A (the old site) is still up and the redirects on that site is properly set up in the htaccess on that server, I don't see any reason to also use it on the new sites.
-
Thanks Yannick
I'm tracking with you except I have to make the subfolders go not to site B, but new sites...C and D. So can I do it like this:
RedirectMatch 301 /subdirectory/(.*) http://www.websiteC.com/$1
and then
RedirectMatch 301 /subdirectory/(.*) http://www.websiteD.com/$1
The urls match. But the subfolder pages have very few links so I'm less concerned about link juice then just getting the indexing to avoid a bunch of 404s.
The subdirectories on site A got split into 2 freestanding domains for "branding"....and have added a bunch of new pages that don't correspond to the old folder (though some do). They also moved from drupal to WP and I wonder if I need the old htaccess instructions for drupal ? We're keeping the old site in place for a while during the migration.
Thanks so much again for the reply
-
Hi Ellen,
If you only wanted to redirect all the url's in a certain subdirectory to the new site (not 1-on1), your redirect would look something like this:
RedirectMatch 301 ^/subdirectory/$ http://www.websiteB.com/
But... I dont think you want to do that (Or should do that...) I think you should want to redirect all pages in the subdirectory to their corresponding url on websiteB.
What I mean by that is: you should redirect all your pages 1-on1, like this:
Redirect: www.websiteA.com/subdirectory/url1.html to its equivalent on website B's url: www.websiteB.com/url1.html
If you want to do that, you can. But the url's have to be the same. You can do something like:
RedirectMatch 301 /subdirectory/(.*) http://www.websiteB.com/$1
If the url's change, than you have to do more manual work. You should always try to redirect as many pages 1on1 as you can. Especially the ones that receive external links. The new pages will be almost as "juicy" as the old pages, because the 301 redirect passes the linkjuice along. (not all of it though, but like 90% - 99%)
Is this pushing you a bit in the right direction?
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
-
Will 301s to Amazon Hurt Site?
We have 155 podcasts and in many we have affiliate links to Amazon. But I recently found out that one of the two products we are promoting is no longer available. I now have to fix many podcast descriptions. My thought is maybe to build a link like: financiallysimple.com/camera and 301 it to the Amazon product. That way if the product changes, I simply change where the 301 points. Simple. BUT my question is does that bouncing people offsite immediately hurt us? Are there any other options that will accomplish the same goal?
Technical SEO | | jgoethert
Thanks!1 -
Query on Site Architecture
Hi All, When I check on my ecommerce site in one of the architecture tool in that my Ecommerce Homepage interlink with 765 pages whereas when I check few competitors and big brands then there homepage linked with 28 pages, 33, 47, 57 etc not like my site 765 pages. Do I am wrong anywhere? Can you please check the screenshot of mine & one of the competitor's site architecture? Because as per me site architecture also play good role in google organic ranking. vXs5dh2 16wre
Technical SEO | | pragnesh96390 -
Hosting set up in different country
Hi Guy's, I was wondering if it matters if your hosting servers is set on a different country than where you're website is targeting (.de (germany) website and the server is in france) Thanks!
Technical SEO | | Happy-SEO2 -
Google displaying different meta descriptions for the same URL but different keyword
Hi All, A quick question that may even have a quick answer: Why would Google display a different meta description for the same URL for a different keyword? For example I enter 2 of our similar keywords into Google: KEYWORD A | META DESCRIPTION A DISPLAYED | URL A KEYWORD B | META DESCRIPTION B DISPLAYED | URL A Thanks in advance
Technical SEO | | SO_UK0 -
Yoast settings for ecommerce site
Hello, I can't find the answer anywhere so I wonder if someone here could help? The ecommerce site I have has Yoast and Woocommerce installed. The Post Types tab under Titles and Metas has various options: Posts, pages, media, products, gift cards. There is also custom post type archives for products and gift cards. Should i noindex the media and also the custom post type archives for product and gift cards and if so why? What about the taxonomies for ecommerce? What's best practise? Noindex? I understand the settings for Yoast when its not an ecommerce site but this has kind of thrown me. Thanks
Technical SEO | | AL123al0 -
No progress in 3 months!!
Hi All
Technical SEO | | mker
I have been using Moz for about 3 months now and love the tools and support. I have been working really hard on seo improvements, fixing lots of coding errors and adding content to my site. My last 3 keyword reports have been very disappointing. I have lost rankings in many of my keywords and some have been ranked very well for years. (talking google) I see only 2 factors that have changed. 1. My 'improvements' and 2. the google update. As everyone knows seo is very time consuming and I am so disappointed with my site going backwards after such a dedicated focus. An example would be the keyword 'christmas return address labels'. I am not even ranked in the top 100 and the last report put me down 50! Here is a link to my category page for funny christmas cards for another example: http://www.stonehousecollection.com/cards/funny-christmas-cards.html BTW I sell greeting cards and I am so frustrated that Zazzle seems to dominate every keyword and google shopping result. It seems they are gaming the system. P.S. If you are an seo professional I would be interested in your services as well. Thank you0 -
301 redirecting old content from one site to updated content on a different site
I have a client with two websites. Here are some details, sorry I can't be more specific! Their older site -- specific to one product -- has a very high DA and about 75K visits per month, 80% of which comes from search engines. Their newer site -- focused generally on the brand -- is their top priority. The content here is much better. The vast majority of visits are from referrals (mainly social channels and an email newsletter) and direct traffic. Search traffic is relatively low though. I really want to boost search traffic to site #2. And I'd like to piggy back off some of the search traffic from site #1. Here's my question: If a particular article on site #1 (that ranks very well) needs to be updated, what's the risk/reward of updating the content on site #2 instead and 301 redirecting the original post to the newer post on site #2? Part 2: There are dozens of posts on site #1 that can be improved and updated. Is there an extra risk (or diminishing returns) associated with doing this across many posts? Hope this makes sense. Thanks for your help!
Technical SEO | | djreich0 -
Have my site been penalised ?
Hi, I recently hired a link builder (who works for a digital marketing agency and wanted to earn some extra cash ) to do some link building for me on keyword Carpet Cleaner Hire Basically , May my ranking for this work has moved from 29 up to 13 , then down to 500 + and now up to 67 ?. It's been all over the place and I am worried that maybe google thinks its unnatural or to many links etc. I looked at some of the work this chap did and there was a log of bookmarks done , apparently to increase social awareness and some articles on random forums I never heard of but the articles didn't look to good and in my eyes were a little spammy.. I don't have any messages in WMT saying I have been penalised or anything but I am naturally worried that this chap may have caused damaged and that I was manually penalised. I have since asked him to stop immediately.. does this sound normal for the ranking to be all over the place in this manner when link building ? How can I tell if I have been manually penalized in any way ? What;s the general consensus ?. Should I contact google or leave it and see what happens ? Other keywords seems to be okay though. Any advice much appreciated. thanks Sarah.
Technical SEO | | SarahCollins1