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. Redirecting index.html to the root

    Redirecting index.html to the root

    Intermediate & Advanced SEO
    10 7 40.5k
    • 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.
    • romanbond
      romanbond last edited by

      Hi, I was wondering if there is a safe way to consolidate link juice on a single version of a home page. I find incoming links to my site that link to both mysite.com/ and mysite.com/index.html. I've decided to go with mysite.com/ as my main and only URL for the site and now I'd like to transfer all link juice from mysite.com/index.html to mysite.com/
      When i tried 301 redirect from index.html to the root it created an indefinite loop, of course.

      I know I can use a RewriteRule.., but will it transfer the juice??

      Please help!

      1 Reply Last reply Reply Quote 2
      • StreamlineMetrics
        StreamlineMetrics last edited by

        It's definitely a good idea to 301 redirect index.html to your root to consolidate link juice. I am assuming you have an .htaccess file so the following lines should work -

        RewriteEngine On
        RewriteBase /

        redirect html pages to the root domain

        RewriteRule ^index.html$ / [NC,R,L]

        romanbond 1 Reply Last reply Reply Quote 6
        • romanbond
          romanbond @StreamlineMetrics last edited by

          thanks, that was quick!
          A couple of questions before i go ahead and implement it:

          will this rule re-direct all index.html(s) to their appropriate roots or will it work just for the home page?
          Also, as far as user's expirience is concerned this will take care of redirecting requests to show index.html to the root, but what about the juice transfer. Will Google treat it as 301?

          StreamlineMetrics 1 Reply Last reply Reply Quote 3
          • StreamlineMetrics
            StreamlineMetrics @romanbond last edited by

            If you want to redirect all index.html(s) to their roots, then try this code -

            RewriteEngine On
            RewriteRule ^index.html$ / [R=301,L]
            RewriteRule ^(.*)/index.html$ /$1/ [R=301,L]

            And yes, Google will treat them as 301 redirects so your juice will be transferred and consolidated.

            romanbond almusammem wideangle salena580 4 Replies Last reply Reply Quote 5
            • romanbond
              romanbond @StreamlineMetrics last edited by

              that seems to be working well. thanks a lot for your help.

              1 Reply Last reply Reply Quote 0
              • enxaqueca
                enxaqueca last edited by

                Thank you, Streamline Metrics. I looked everywhere and tried several different edits in my htaccess for a 301 redirect from index.html to root, but none worked. Your code worked wonderfully.

                1 Reply Last reply Reply Quote 0
                • webfeatus
                  webfeatus last edited by

                  Google may see this as a 301 but MOZ crawl does not seem to.
                  Can you please help explain this?

                  I am looking for a good .htaccess code for this redirect.

                  1 Reply Last reply Reply Quote 0
                  • almusammem
                    almusammem @StreamlineMetrics last edited by

                    Thank you very much, this works fine with me.

                    1 Reply Last reply Reply Quote 0
                    • wideangle
                      wideangle @StreamlineMetrics last edited by

                      works, thank you!

                      1 Reply Last reply Reply Quote 0
                      • salena580
                        salena580 @StreamlineMetrics last edited by

                        It works good for my site https://uaedesertsafari.com/

                        1 Reply Last reply Reply Quote 0
                        • 1 / 1
                        • First post
                          Last post
                        • To remove or not remove a redirected page from index
                          JOkoiue
                          JOkoiue
                          0
                          7
                          49

                        • Google Is Indexing my 301 Redirects to Other sites
                          Keszi
                          Keszi
                          0
                          4
                          573

                        • In the google index but search redirects to homepage
                          GPainter
                          GPainter
                          0
                          2
                          53

                        • Redirect root to detailed page
                          DmitriiK
                          DmitriiK
                          1
                          2
                          84

                        • To redirect or not to redirect, that is the question
                          CommT
                          CommT
                          0
                          5
                          126

                        • How to use a 301 Redirect when the first 301 Redirect is not the same as what's indexed?
                          PatriotOutfitters81
                          PatriotOutfitters81
                          0
                          3
                          66

                        • Redirecting, then redirecting back
                          Highland
                          Highland
                          0
                          2
                          256

                        • How To 301 Redirect .html pages
                          ShaMenz
                          ShaMenz
                          0
                          4
                          15.3k

                        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