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. Technical SEO Issues
    4. Right redirect to transfer juice www, no-www and website movement

    Right redirect to transfer juice www, no-www and website movement

    Technical SEO Issues
    6 2 519
    • 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.
    • darkanweb
      darkanweb last edited by

      Hi here is my problem, I have a website which works both with www. and without www; Now I want to optimize it and transfer it to another new domain  along with the link juice of both the old domain with www and without www. I don't want to do it with multiple redirects but with just one clean redirect (I know that search engines don't like that, am I right?). What should I write in the .htaccess of the old domain and in the one of the new domain?

      To summarize I want something like that:

      www.oldsite.com/anyfile.html>301>www.newsite.com/anyfile.html

      oldsite.com/anyfile.html>301>www.newsite.com/anyfile.html

      newsite.com/anyfile.html>301?>www.newsite.com/anyfile.html

      Thanks

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

        Hi Simone

        I think this will help solve your problem -

        http://www.seomoz.org/blog/url-rewrites-and-301-redirects-how-does-it-all-work

        and how to actually do it -

        http://www.webconfs.com/how-to-redirect-a-webpage.php/

        You will only need to create the redirect in the old domains htaccess file so that all traffic to the old domain will go to the new one.

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

          This is general information about the topic that I already know. What I need is the exact code to insert in my .htaccess to be sure that I am doing the best redirects for my specific case.

          Thanks anyway Matt.

          Matt-Williamson darkanweb 3 Replies Last reply Reply Quote 0
          • Matt-Williamson
            Matt-Williamson @darkanweb last edited by

            RewriteEngine on RewriteCond %{HTTP_HOST} ^olddomain.co.uk$ [OR]

            RewriteCond %{HTTP_HOST} ^www.olddomain.co.uk$

            RewriteRule ^/?$ "http://www.newdomain.co.uk" [R=301,L]

            Add this to your .htaccess file of your oldsite and it will redirect both www. and none www. to your new domain passing on link juice - sorry I wasn't specific before.

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

              Ok thank you very much for the useful answer. I have one more question for you. What about if I want to redirect page by page?

              Is something like this going to work?

              RewriteEngine on RewriteCond %{HTTP_HOST} ^olddomain.com$ [OR]

              RewriteCond %{HTTP_HOST} ^www.olddomain.com$

              RewriteRule ^page1.html "http://www.newdomain.com/page1.html" [R=301,L]

              RewriteRule ^page2.html "http://www.newdomain.com/page2.html" [R=301,L]

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

                Yes if you just want to redirect individual pages like that - you could have it so any requests on the domain www and none redirect to the new domain and then specific pages can point to specific pages - see below:

                RewriteEngine on

                RewriteCond %{HTTP_HOST} ^olddomain.co.uk$ [OR]

                RewriteCond %{HTTP_HOST} ^www.olddomain.co.uk$

                RewriteRule ^/?$ "http://www.newdomain.co.uk" [R=301,L]

                RewriteRule ^page2.html$ "http://www.newdomain.com/page2.html" [R=301,L]

                1 Reply Last reply Reply Quote 1
                • 1 / 1
                • First post
                  Last post
                • Redirect our www.website.com to website. Com/target-keyword
                  advertisingcloud
                  advertisingcloud
                  0
                  4
                  79

                • 301 redirect to WWW on a 2 year old website with good SERPs and organic traffic?
                  OlegKorneitchouk
                  OlegKorneitchouk
                  0
                  9
                  153

                • Canonicial redirect non-www to WWW in Magento
                  Paul_MC
                  Paul_MC
                  0
                  3
                  4.3k

                • Redirect non www. domain to WWW. domain for established website?
                  malecce
                  malecce
                  0
                  2
                  207

                • Website Redirects
                  JonathanLeplang
                  JonathanLeplang
                  0
                  4
                  236

                • To 301 redirect or not to 301 redirect? duplicate content problem www.domain.com and www.domain.com/en/
                  Chris-CA
                  Chris-CA
                  0
                  5
                  456

                • Two companies merge: website A redirect 301 to website B. Problems?
                  Mike_c
                  Mike_c
                  0
                  4
                  1.5k

                • How do I redirect non-www to www in IIS?
                  tylerfraser
                  tylerfraser
                  0
                  2
                  986

                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

                Join our newsletter
                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