How is it possible to 301 specific pages to a new domain?
-
The old site is small, only 100 pages or so, and about 10 of them are particularly useful. I would like to 301 those 10 pages to 10 similar pages on the new site, and also 301 the other 90 pages to the new site... the new site's home page, I suppose.
Does it make sense to do this and if so how?
I think if I simply 301 the whole of the old domain to the new one, the juice will be shared among the new site's page equally which is not what I want. I know where the htaccess file is and I can 301 a page within a domain but I'm at a loss with this. Thanks for any help.
EDIT:
I'm hoping for something like this:
old.com/page_1 >> new.com/page_A
old.com/page_2 >> new.com/page_B
... and 8 more of those
And then the other 90 pages:
old.com/Remaining pages >> new.com/index
-
Glad it helped and the explanation below is nicely done.
-
Thanks Matt, that put me on the right track. I have posted a full solution is you need it anytime.
-
SOLUTION:
Options +FollowSymlinks RewriteEngine On
#redirect this type of url www.old.com/index.php?everything-after-the-question-mark to a new url
RewriteCond %{QUERY_STRING} ^everything-after-the-question-mark$ RewriteRule ^index.php$ http://www.new.com/new-page? [L,R=301]
#change the above for every specific url with a query string that you want to send to a specific url
#for capturing the rest of the site's query string urls and sending them to a single page - the home page in this example:
RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^index.php$ http://www.new.com? [L,R=301]
#www.old.com doesn't have a query string so needs its own 301:
Redirect 301 / http://www.new.com
-
I think the issue you are having is because you are redirecting a dynamic URL and this is what is causing the problem. There was Q&A on here regarding this ages ago I will try and find it and let you have the link - unless we have an expert that wants to step in..
Try adding a rewrite condition before a rewrite rule:
RewriteCond %{QUERY_STRING} route=product/product&product_id=51
-
For some reason it doesn't work. I've changed the fifth line below for posting here, but the four lines above it is the code that I used in the htaccess. Because it's a 1and1 server which use php4 as default, it has an extra line to use php 5, which the site has always had. The domain-to-domain 301 works ok with this extra line.
AddType x-mapp-php5 .php
Options +FollowSymlinks
RewriteEngine On
Redirect 301 /index.php?route=product/product&product_id=51 http://www.newdomain.com/new-page
-
try this below
Options +FollowSymLinks RewriteEngine on
Redirect 301 /oldpage.html http://www.newdomain.com/newpage.html ```
-
Thanks Matt
The domain-to-domain redirect works but the page-to-page doesn't, even when the page-to-page is the only instruction below "RewriteEngine on".
-
Hi - yeah place all your specific redirects first and then add you blanket redirect at the end.
-
Sorry Matt, that was a bad typo. I've changed that now... I meant 301 those 10 pages to 10 similar pages".
Thanks very much for the link. I might just have to test this with a dormant domain and see if it works, but my worry is that the command to redirect the whole domain will override the commands to redirect the individual pages.
RewriteEngine on
#I would have ten of these:
rewriterule ^index.phproute=product/product&product_id=52(.*)$ http://www.new.co.uk/products/new$1 [r=301,nc]
######## As I would prefer not to do the above for all 100 pages, I would need a way to redirect the remaining pages. I don't know if the following accomplishes this as it's simply a command to redirect the domain?
#######Options +FollowSymLinksRewriteEngine onRewriteRule (.*) http://www.new.co.uk/$1 [R=301,L]
-
Sorry my confusion - when you said "301 those 10 pages to 120 similar pages on the new site". Then your idea is correct it will be best to redirect your old page to a specific new one - I have done this successfully many times myself.
You can does this with your .htaccess - easiest way for you would be to use this:
http://www.webconfs.com/htaccess-redirect-generator.php
When using the tool you only need to initiate the rewrite engine once then just copy the last line for each url redirect:
include this only once:
Options +FollowSymlinks
RewriteEngine on
-
Hi Matt,
It will be one-to-one:
old.com/page_1 >> new.com/page_A
old.com/page_2 >> new.com/page_B
... and 8 more of those
And then the other 90 pages:
old.com/Remaining pages >> new.com/index
-
To me it doesn't make sense to redirect a page using a permanent redirect that tells the search engines the old page has moved to multiple new pages - the new page should only exist in one location from a duplicate content and link juice point of view. I think that would be an improper use of a 301 redirect. You could group pages and point the old page to the first page of each group.
Also note as far as I am aware this is not possible as a 301 redirect will send you to a single location not multiple when you type the old address, so you could point 10 pages at 120 other than creating 10 index pages which group those 120 and pointing one of the 10 original at each of them...
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 Old domain with HTTPS to new domain with HTTPS
I am a bit boggled about https to https we redirected olddomain.com to https://www.newdomain.com, but redirecting https://www.olddomain.com or non-www is not possible. because the certificate does not exist on a level where you are redirecting. only if I setup a new host and add a htaccess file will this work. What should I do? just redirect the rest and hope for the best?
Intermediate & Advanced SEO | | waqid0 -
301 Redirect from query string to new static page
If i want to create a redirect from a page where the slug ends like this "/?i=4839&mid=1000&id=41537" to a static, more SEO friendly slug like "/contact-us/", will a standard 301 redirect suffice? Thanks, Nails
Intermediate & Advanced SEO | | matt.nails0 -
Subdomain vs totally new domain
Problem: Our organization publish maps for public viewing using google maps. We are currently getting limited value from these links. We need to separate our public and private maps for infrastructure purposes, and are weighing up the strengths and weaknesses of separating by domain or sub domain with regards SEO and infrastructure. Current situation: maps.mycompany.com currently has a page authority of 30 and mycompany.com has a domain authority of 39. We are currently only getting links from 8 maps which are shared via social media whereas most people embed our maps on their website using an iframe which I believe doesn't do us any favour with SEO. We currently have approx 3K public maps. Question: What SEO impact can you see if we move our public maps from the subdomain maps.mycompany.com to mycompanypublicmaps.com? Thanks in advance for your help and happy to give more info if you need it!
Intermediate & Advanced SEO | | eSpatial0 -
Can a move to a new domain (with 301's) shake off a google algorithm penalty
we have done everything under the sun using the holy grail of google guidelines to get our site back onto page 1 for our domain. we have recovered (penguin and panda) algorithm filters for keywords that were page 1 going to page 7 and now page 2. its been 2 years and we cant hit page 1 again. this is our final phase we cna think of.. do you thin kit will work if we move to a new domain. and how much traffic/rankings can we expect to lose in the short-term?
Intermediate & Advanced SEO | | Direct_Ram0 -
New site started ranking, lost ground after 301...?
Hi everyone. So we decided to re-brand a website starting with a fresh domain and fresh website (new everything). The first 4 weeks the site was performing really well and started bringing organic traffic for several targeted keywords (small amounts, but something). Around 5 weeks later, we decided to perform a 301 Redirect from an older site we had that really hadn't changed since 2007. As soon as we performed the 301, we started loosing ground on the keywords that were starting to perform. I may help to mention that we were targeting different keywords on the new site, versus the keywords/industry that were targeted on the older site... because we were focusing on another but similar industry. Now, 10 weeks later we are still not showing up for the keywords that we were starting to make headway on in the first four weeks of starting.... any ideas why? suggestions? The 301's were performed properly. We verified them, and we check Google WMT for any additional ones that may still be out there, but try to fix them as soon as possible. We have grown the site from just a few pages to over 60+ pages in the last 2 months with unique and fresh content targetting those keywords... Thank you in advance
Intermediate & Advanced SEO | | co.mc0 -
Help understanding 301 domain redirect
Can anyone help me understand a specific process of a 301 redirecting a domain. Here is what I would like to know.... When you 301 redirect a site, most if not all the links follow to your new site. But how does this process happen? 1.When Google sees the new domain does it simply apply the backlink profile of the old site to the new one? 2. Does it have to re-crawl all the links one by one and apply them to the new domain? 3. or something else?
Intermediate & Advanced SEO | | gazzerman10 -
Splitting one Website into 2 Different New Websites with 301 redirects, help?
Here's the deal. My website stbands.com does fairly well. The only issue it is facing a long term branding crisis. It sells custom products and sporting goods. We decided that we want to make a sporting goods website for the retail stuff and then a custom site only focusing on the custom stuff. One website transformed and broken into 2 new ones, with two new brand names. The way we are thinking about doing this is doing a lot of 301 redirects, but what do we do with the homepage (stbands.com) and what is the best practice to make sure we don't lose traffic to the categories, etc.? Which new website do we 301 the homepage to? It's rough because for some keywords we rank 3 or 4 times on the first page. Scary times, but something must be done for the long term. Any advise is greatly appreciated. Thank you in advance. We are set for a busy next few months 🙂
Intermediate & Advanced SEO | | Hyrule0 -
10,000 New Pages of New Content - Should I Block in Robots.txt?
I'm almost ready to launch a redesign of a client's website. The new site has over 10,000 new product pages, which contain unique product descriptions, but do feature some similar text to other products throughout the site. An example of the page similarities would be the following two products: Brown leather 2 seat sofa Brown leather 4 seat corner sofa Obviously, the products are different, but the pages feature very similar terms and phrases. I'm worried that the Panda update will mean that these pages are sand-boxed and/or penalised. Would you block the new pages? Add them gradually? What would you recommend in this situation?
Intermediate & Advanced SEO | | cmaddison0