The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Intermediate & Advanced SEO
    4. How is it possible to 301 specific pages to a new domain?

    How is it possible to 301 specific pages to a new domain?

    Intermediate & Advanced SEO
    13 2 588
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Matt-Williamson
      Matt-Williamson @Brocberry last edited by

      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

      1 Reply Last reply Reply Quote 0
      • Brocberry
        Brocberry @Brocberry last edited by

        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]

        1 Reply Last reply Reply Quote 0
        • Matt-Williamson
          Matt-Williamson @Brocberry last edited by

          Hi - yeah place all your specific redirects first and then add you blanket redirect at the end.

          1 Reply Last reply Reply Quote 0
          • Brocberry
            Brocberry @Brocberry last edited by

            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".

            1 Reply Last reply Reply Quote 0
            • Matt-Williamson
              Matt-Williamson @Brocberry last edited by

              try this below 
              
              Options +FollowSymLinks
              RewriteEngine on
              
              Redirect 301 /oldpage.html http://www.newdomain.com/newpage.html
              ```
              1 Reply Last reply Reply Quote 0
              • Brocberry
                Brocberry @Brocberry last edited by

                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

                1 Reply Last reply Reply Quote 0
                • Matt-Williamson
                  Matt-Williamson @Brocberry last edited by

                  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 
                  
                  
                  1 Reply Last reply Reply Quote 1
                  • Brocberry
                    Brocberry last edited by

                    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

                    1 Reply Last reply Reply Quote 1
                    • Brocberry
                      Brocberry @Brocberry last edited by

                      Thanks Matt, that put me on the right track. I have posted a full solution is you need it anytime.

                      1 Reply Last reply Reply Quote 0
                      • Matt-Williamson
                        Matt-Williamson @Brocberry last edited by

                        Glad it helped and the explanation below is nicely done.

                        1 Reply Last reply Reply Quote 0
                        • 1 / 1
                        • First post
                          Last post
                        • New Domain, No 301 Possible - Any Advice
                          DmitriiK
                          DmitriiK
                          0
                          2
                          35

                        • Possible issues with 301 redirecting to a new domain name
                          benesmartin
                          benesmartin
                          0
                          2
                          35

                        • New Domain VS New Page Backlink?
                          TomRayner
                          TomRayner
                          0
                          2
                          148

                        • 301'd an important, ranking page to the wrong new page, any recourse?
                          RyanPurkey
                          RyanPurkey
                          0
                          4
                          55

                        • Does link equity to a page that is 301'd to a new domain pass juice on?
                          bjs2010
                          bjs2010
                          0
                          3
                          184

                        • 301 a strong but under-performing landing page to a new domain?
                          Dr-Pete
                          Dr-Pete
                          0
                          5
                          518

                        • 301 - should I redirect entire domain or page for page?
                          dunklea
                          dunklea
                          0
                          4
                          679

                        • 301 from penalized domain to new domain
                          EGOL
                          EGOL
                          0
                          2
                          726

                        Get started with Moz Pro!

                        Unlock the power of advanced SEO tools and data-driven insights.

                        Start my free trial
                        Products
                        • Moz Pro
                        • Moz Local
                        • Moz API
                        • Moz Data
                        • STAT
                        • Product Updates
                        Moz Solutions
                        • SMB Solutions
                        • Agency Solutions
                        • Enterprise Solutions
                        • Digital Marketers
                        Free SEO Tools
                        • Domain Authority Checker
                        • Link Explorer
                        • Keyword Explorer
                        • Competitive Research
                        • Brand Authority Checker
                        • Local Citation Checker
                        • MozBar Extension
                        • MozCast
                        Resources
                        • Blog
                        • SEO Learning Center
                        • Help Hub
                        • Beginner's Guide to SEO
                        • How-to Guides
                        • Moz Academy
                        • API Docs
                        About Moz
                        • About
                        • Team
                        • Careers
                        • Contact
                        Why Moz
                        • Case Studies
                        • Testimonials
                        Get Involved
                        • Become an Affiliate
                        • MozCon
                        • Webinars
                        • Practical Marketer Series
                        • MozPod
                        Connect with us

                        Contact the Help team

                        Moz logo
                        © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                        • Accessibility
                        • Terms of Use
                        • Privacy