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
-
How Can I Redirect an Old Domain to Our New Domain in .htaccess?
There is an old version of http://chesapeakeregional.com still floating around the web here: http://www.dev3.com.php53-24.dfw1-2.websitetestlink.com/component/content/category/20-our-services. Various iterations of this domain pop up when I do certain site:searches and for some queries as well (such as "Diagnostic Center of Chesapeake"). About 3 months ago the websitetestlink site had files and a fully functional navigation but now it mostly returns 404 or 500 errors. I'd like to redirect the site to our newer site, but don't believe I can do that in chesapeakeregional.com's .htaccess file. Is that so and would I need access to the websitetestlink .htaccess to forward the domain? Note* I (nor anyone else in our organization) has the login for the old site. The new site went live about 9 months before I arrived at the organization and I've been slowly putting the pieces together since arriving.
Intermediate & Advanced SEO | | smpomoryCRH0 -
301 / 404 & Getting Rid of Keyword Pages
I had a feeling that my keyword focused pages were causing my site not to rank well. I do not have that many keywords. I have 2 main keyword phrases along with 6 city locations. For example (fake) "tea house tampa" "tea house clearwater" "tea house sarasota" and "tea room tampa" "tea room cleawater" "tea house sarasota". So, I don't feel that I need that many pages. I feel like I can optimize my home page and maybe 1 or 2 topic pages. Right now, I have a keyword for each of those phrases. These are all internal pages on 1 domain. Not multiple domains. Sooo... I tested it by 301ing a few of my "tea house" KW pages to the home page. And low and behold... my home page rose BIG TIME! Major improvement! I'm talking like 13th to 2nd! Here is my question... how should I proceed? My SEO has warned me against 301ing too many pages all pointing to the home page. He says that will negatively impact my ratings. Should I 404 some pages? Should I build a "tea room" topic page and 301 that set there? What is worse? 301 or 404? How many is too many? I'm really excited by these results, but I'm scare to move forward and hurt what has happened. Thanks in advance!
Intermediate & Advanced SEO | | CalicoKitty20000 -
"No index" page still shows in search results and paginated pages shows page 2 in results
I have "no index, follow" on some pages, which I set 2 weeks ago. Today I see one of these pages showing in Google Search Results. I am using rel=next prev on pages, yet Page 2 of a string of pages showed up in results before Page 1. What could be the issue?
Intermediate & Advanced SEO | | khi50 -
Update content or create a new page for a year related blog post?
I have a page called 'video statistics 2013' which ranks really well for video stat searches and drives in a lot of traffic to the site. Am I best to just change the title etc to 2014 and update the content, or create a totally new page? The page has 2013 in the URL as well which may be a problem for just updating?
Intermediate & Advanced SEO | | JonWhiting0 -
Google Webmaster Tools > HTML Improvements > 301 Moved Permanently pages - how did they even get there?
Hello experts! I'm going through my Google Webmaster Tools > HTML Improvements looking for pages with duplicate meta descriptions/titles that I can fix. And I noticed there are about 60 pages odd looking page titles that have duplicate meta descriptions, which are also noted as: 301 Moved Permanently Moved Permanently The document has moved here. Apache Server at sports When I click on the link to see the page names, all of them are pages we never created. The pages are all sports blog related. Here are few examples: http://www.titanium-jewelry.com/justin-tuck-blog.html http://www.titanium-jewelry.com/unlimited-potential-project-blog.html http://www.titanium-jewelry.com/left-handed-baseball-glove-blog.html http://www.titanium-jewelry.com/adjustable-basketball-hoops-blog.html how did they get on our site? Is this some sort of malicious attack? Most of them are sports related blog looking names. I just don't know how these pages could have been created. 2) is this hurting us with Google?3) Can you tell when the page was created?Thanks ron xEtX3op.jpg
Intermediate & Advanced SEO | | yatesandcojewelers0 -
301 redirect w/ dynamic pages to static
I am trying to redirect old dynamically created pages to a new static one (single page). However, when I implement the redirects, it still uses part of the old dynamic url. For instance... dynamic.php?var=example1 dynamic.php?var=example2 dynamic.php?var=example3 should all redirect to: static.html. However, they are redirecting to: static.html?var=example1 static.html?var=example2 static.html?var=example3 The page is resolving fine, but I don't want google to misinterpret the new static page as numerous page with dup content. I tried this in PHP on the dynamic.php page as follows, but it the problem above persisted: header('HTTP/1.1 301 Moved Permanently');
Intermediate & Advanced SEO | | TheDude
header('Location: http://www.mysite.com/static.html'); I tried doing it in my .htaccess file as follows, but the problem persisted: redirect 301 /info/tool_stimulus.php?var=example1 http://www.mysite.com/static.html
redirect 301 /dynamic.php?var=example2 http://www.mysite.com/static.html Can anyone solve this in PHP or w/ htaccess? Help!!! 🙂0 -
External links point to 403 page - how to 301 redirect if no file extension?
Hi guys, After moving from an old static .htm site to Wordpress, I 301'd all old .htm urls fine to the new trailing slash foldery style /wordpress-urls/ in htaccess no problem. But Google Webmaster Tools tells me I still have hundreds of external links pointing to a similar version of the old urls (but without the .htm), giving lots of not founds and 403s. Example of the urls linked to that 403 not found: http://www.mydomain.com/filename So I'm wondering how I do a 301 redirect from a non-exisiting url that also has no file extention as above and is not like a folder? This seems like a lot of possible external link juice to lose. Thanks!
Intermediate & Advanced SEO | | emerald0 -
Keyworded loaded subdirectory possibly diluting the page value?
Hey everyone, I have an ecommerce website which sells "Widgets" and is called "Widget.com" (exact match singular domain name) I have architect-ed my pages to be like this: www.widget.com/widgets/product-page.html I loaded in the plural (or in some instances a keyword variant) as a subdirectory before my products, and some of my category pages. Does this approach make sense anymore, or am I devaluing my pages ultimately by removing them from the root? thanks a lot!
Intermediate & Advanced SEO | | SwissNinja0