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
-
Phasing in new website on www2 domain - 301 plan
Hi, I work for a large company and we're planning to phase in a new website. The idea is to develop key journeys on the new site and serve them on a www2 domain, removing them from the old website which is served on the www domain. The reason for this is because the old website is over 2,000 pages, and the management want to see new, improved journeys sooner rather than later. So, rather than launching all new pages and journeys at the same time, which will take a long time to design and develop, key journeys will move across to the new site / design sooner and made available to visitors. Whilst the overall journey might be a bit disjointed in parts (i.e. sending people from old to new site, and vice versa) I can't see a better way of doing it... Once all new content is complete, 301s will be implemented from old content on www. to new content www2. Once the phasing is complete, and all new content is in place on www2, 301s will be implemented to point everything back to www. Does anybody see any problems with this approach? Or any ideas on how to better handle this situation? Thanks Mozzers!
Intermediate & Advanced SEO | | RWesley0 -
Hreflang and canonical tag for new country specific website - different base domain
I have a little different situation compared to most other questions which asks for hreflang and canonical tags for country specific version of websites. This is an SEO related question and I was hoping to get some insight on your recommendations. We have an existing Australian website - say - ausnight.com.au now we want to launch a UK version of this website - the domain is - uknight.co.uk please note, we are not only changing from .com.au to .co.uk.... but the base domain name as well changed - from ausnight to uknight as you can understand, the audience for both websites is different. Both websites has most pages same with same contents.... the questions I have is - Should we put canonical tag on the new website pages? If we don't put canon tag on new website pages, what is the impact on the SEO ranking of current website? I believe we need to put hreflang tag on both websites to tell google that we have another language version (en-au vs en-gb) of the same page. Is this correct?
Intermediate & Advanced SEO | | TinoSharp0 -
Where/how do you set up 301 redirects when keeping the same domain and not preserving the filename?
Hi there, I'm just reaching to to ask for some help in understanding where 301 redirects should be set up on a website when keeping the same domain but not preserving the original filenames? Essentially what is happening is an old website is being completely overhauled and brought up to date from a technical and usability standpoint. While the SEO isn't great naturally many of the pages have been indexed by google over time. A few pages have decent statistics and I don't want to lose the juice from them, but they do still need a lot of improving. So my question is this, would all the redirection take place in the .htaccess file only in this case? From reading here on Moz I think this is the case, but I need to confirm that. I was reading this article which has thrown me slightly: https://moz.com/learn/seo/redirection but this seems more complex as the website was actually moving domains. Open to any insight and if you need further clarification or information let me know.
Intermediate & Advanced SEO | | SEODarren0 -
Removing Blogs and 301 redirect to blog home page?
Hi, I was at the MozCon conference in Seattle this Summer and heard great concepts about deleting a lot of pages on your site that are deemed excess. It got me thinking to remove all of our old blogs that were: Sales(ee) less than 400 words Flat out bad blogs When i begin removing these links, i know i will get a lot of 404 errors because of previous social links. So in your opinion, what would you do? Do i just 301 those blogs to my main /blog page? Thanks
Intermediate & Advanced SEO | | Shawn1240 -
How do i migrate from Volusion to Magento with the same domain using 301 redirect?
We are thinking about migrating our site from Volusion to Magento due to traffic reasons, our site's been growing and we're going way over the bandwidth limit (40gb) for Volusion every month. It only make sense for us to start on Magento CE where we can host it on our site and use our own bandwidth. We will be using the same domain, and changing our URLs to make things better (we were somewhat restricted by Volusion so we couldn't optimize some of our URL addresses). Here's comes the main question, since we are ranking pretty good for the keywords that we're targeting, we ABSOLUTELY DON'T want to lose any traffic or ranking from our pages, I know that there's something called the 301 redirect that we can use, but how can this be done? When we migrate the site, we will need to point our domain to Magento from Volusion, so basically Volusion store will be down... if we are changing domain names then the 301 redirect makes sense because we can have the original store live while it's redirecting to a completely new address. Is there any method to still setup this 301 redirect, or is there something else I can do to save our rankings??? Thanks in advance!
Intermediate & Advanced SEO | | s2bkevin0 -
Varying Internal Link Anchor Text with Each New Page Load
I'm asking for people's opinions on varying internal anchor text. Before you jump in and say, "Oh yes, varying your anchor text is always a good idea", let me explain. I'm not talking about varying anchor text on different links scattered throughout a site. We all know that is a wise thing to do for a variety of reasons that have been covered in many places. What I'm talking about is including semi-useful links below the fold and then varying the anchor text with each page load. Each time Googlebot crawls a page, it sees different anchor text for each link. That way, Googlebot is seeing, for example, 'san diego bars', 'taverns in san diego', 'san diego clubs', and 'pubs in san diego' all pointing to a San Diego bar/tavern/club/pub page. I'm wondering if there is value in this approach. Will it help a site rank well for multiple search queries? Could it potentially be better than static anchor text as it may help Google better understand the targeted page? Is it a good way to protect a large site with a huge number of internal links from Penguin? To summarize, we're talking about the impact of varying the anchor text on a single page with each page load as opposed to varying the anchor text on different pages. Thoughts?
Intermediate & Advanced SEO | | RyanOD0 -
Does a page on a site with high domain authority build page authority easier? i.e. less inbound links?
Is this also why people build backlinks to their BBB profiles, Yellowpages Profiles, etc. i.e. why do people build backlinks to other pages that link to them? Wouldn't it be more beneficial to just build that backlink directly to your target?
Intermediate & Advanced SEO | | adriandg0 -
Rankings for Home vs. Internal Pages - Potential 301?
Hi everyone: A site I'm working with until recently was ranking page 1 for its primary keyword. For the last month, they've dropped to page 4. One thing we've noticed is that the page that is ranking is an internal page (http://www.example.com/keyword-string) and at this point, everything ranking above us is ranking based on the root domain (http://www.competitor.com). We've eliminated Panda, penalties, and any other obvious causes for the drop in rankings. We have similar or better page rank, external links, domain trust, etc. in comparison to the sites still ranking page 1. We think this may be part of our problem. Has anyone else dealt with this? What did you do to change it and how did it work? We're considering eliminating the existing internal page and 301'ing to the home page. The keyword in question is the core of the business, so this is a natural change, but we're loath to lose years of investment in promoting the internal page. Also, the site was originally optimized with the primary keyword throughout (appears in META tags, headers on multiple pages). How important is it to clear these out to make Google see the home page as most relevant? Thanks!!
Intermediate & Advanced SEO | | kdcomms0