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
-
Please help us undertsand the things we need to improve so that google crawler visit us more often to reindex pages from our domain
we are currently in the process of a massive project which involves us migrating our domain, we realised that Google crawlwer has not been crawling our pages Quiet often. i have observed some cases where google crawled these pages about 6 months back and then never visited the pages again
Intermediate & Advanced SEO | | bhaskaran
and we had to manually submit these pages for reindexing in some geographies. can you please help us undertsand the things we need to improve so that google crawler visit us more often to reindex pages from our domain0 -
URL Structure for geo location for specific page
On hackerearth.com/challenges page, there is an option to select languages. This option is in the footer. Once you select the language the url changes. Ex - if we select French, the URL changes to hackereath.com/fr/challenges. In case we decide to change the URL of this page with Geo, what should be the URL structure which accommodates languages as well. My research says that it would good to keep the url like domainname.com/page/language.
Intermediate & Advanced SEO | | Rajnish_HE0 -
Moving content to a newer domain - 301 re-direct not possible
I had a website that was getting decent traffic. Around 2k visits a day. Owing to some issues, the domain was suspended my the domain provider and they won't be releasing it anytime soon. Now, I'm in talks with my domain provider and it might take some good time to get back the domain live (weeks if not months). So, I have decided to migrate all my content to a new domain. Also, Google has stopped displaying my earlier domain (the suspended domain) in the search results now and I have removed the property from webmaster tools/search console. And since my earlier domain is suspended, redirection is not possible. So, I had a couple query in regards to this: I'm in the process of moving the content from the older suspended domain to the newer domain. What should I do that Google does not penalise my new site on the grounds of duplicate content, etc. What other things I should do while I'm in the process of this migration.
Intermediate & Advanced SEO | | Evaway0 -
How to combine 2 pages (same domain) that rank for same keyword?
Hi Mozzers, A quick question. In the last few months I have noticed that for a number of keywords I am having 2 different pages on my domain show up in the SERP. Always right next to each other (for example, position #7 and #8 or #3 and #4). So in the SERP it looks something like: www.mycompetition1.com www.mycompetition2.com www.mywebsite.com/page1.html
Intermediate & Advanced SEO | | rayvensoft
4) www.mywebsite.com**/page2.html**
5) www.mycompetition3.com Now, I actually need both pages since the content on both pages is different - but on the same topic. Both pages have links to them, but page1.html always tends to have more. So, what is the best practice to tell Google that I only want 1 page to rank? Of course, the idea is that by combining the SEO Juice of both pages, I can push my way up to position 2 or 1. Does anybody have any experience in this? Any advice is much appreciated.0 -
New Website Look/Structure - Should I Redirect or Update Pages w/ Quality Inbound Links
This questing is regarding an ecommerce website that I hand wrote(html) in 1997. One of the first click and buy websites, with cart/admin system that I also developed. After all this time, the Old plain HTML look just doesnt cut it. I just updated to XHTML w/ a very modern look, and believe the structured data will index better. All products and current category pages will have the identical vrls taken from the old version. I decided to go with the switch after manual penalty, which has since been removed... I figured now is the time to update. My big question is that over the years, a lot of my backlinks came from products/news that are either no longer relevant or just not available. The pages do exist, but can only be found from the Outbound Link Source. For SEO purposes, I have thought a few things I can do but can't decide which one is the best choice. Any Insight or suggestions would be Awesome! 1. Redirect the old link to the most relevant page in my current catalog. 2. Add my new header/footer to old page(this will add a navigation bar w/ brands/cats/etc) 3. Simply add a nice new image to the top of these pages linking home & update any broken/irrelevant links. I was also considering adding just the very top 2 inches of my header(logo,search box, phone, address) *note, some of these pages do receive some traffic. Nothing huge, but consider the 50+ pages, it ads up.
Intermediate & Advanced SEO | | Southbay_Carnivorous_Plants0 -
Consolidating MANY separate domains into a much better, single URL: Should I point a landing page or redirect to the new site?
I am consolidating a site for a client who previously, and very foolishly, broke up their domains like so: companyparis.com companyflorence.com companyrome.com etc... I am now done with the new site, which will be at: company.eu with pages as appropriate: company.eu/paris company.eu/florence company.eu/rome This domain, although not entirely new, does not have much authority or rank. In terms of SEO and link-building, is it better to redirect the old domain to the specific page on the new domain: companyparis.com --> company.eu/paris or... is it better to put a landing page at the old domain LINKING to the page on the new domain: companyparis.com --> landing page linking to --> company.eu/paris
Intermediate & Advanced SEO | | thongly0 -
Should i continue linking the old page after a redirect 301?
hi everybody, i'm trying to understand why my page http://poltronafraubrescia.zenucchi.it isn't ranked for the keyword poltrona frau brescia even if is indexed on google. the page gets authority and traffic from the page www.zenucchi.it/ITA/poltrona-frau-brescia.html that is already ranked in fourth position for that keyword. should i continue linking the previous or the new page to increase the page authority? i don't know if is a good way to link a page not ranked despite a ranked one.. Please help me.... thanks a lot
Intermediate & Advanced SEO | | guidoboem0 -
Brand new domain with a lot of old links.
So I just bought http://penny-auctions.co/ a couple of days ago, ignore the fact it's not set up yet and generally just a mess, and something kept bugging me about why the domain authority kept showing as 25 in the SEOmoz toolbar. Now initially I'd set it up as www. and with the trailing slash so the PA was 1, however after a bit of exploration it seems that someone has been building links to the non-www version of the domain for at least a year! The site has never been owned before so I've now made the non-www version the default and have a 5 day old site with PA 35 and DA 25! SEOmoz shows PA - 45 links, 20 domains and DA - 341 links, 113 domains. Majestic Historic - 8598 links, 236 domains and Fresh - 160 links, 62 domains. Brilliant! Except they're all spamtastic. What do you think this will do for my future attempts at ranking? Should I create pages that have links to them or just 301 them?
Intermediate & Advanced SEO | | StalkerB0