Skip to content
    Moz logo Menu open Menu close
    • Products
      • Moz Pro
      • Moz Pro Home
      • Moz Local
      • Moz Local Home
      • STAT
      • Moz API
      • Moz API Home
      • Compare SEO Products
      • Moz Data
    • Free SEO Tools
      • Domain Analysis
      • Keyword Explorer
      • Link Explorer
      • Competitive Research
      • MozBar
      • More Free SEO Tools
    • Learn SEO
      • Beginner's Guide to SEO
      • SEO Learning Center
      • Moz Academy
      • SEO Q&A
      • Webinars, Whitepapers, & Guides
    • Blog
    • Why Moz
      • Agency Solutions
      • Enterprise Solutions
      • Small Business Solutions
      • Case Studies
      • The Moz Story
      • New Releases
    • Log in
    • Log out
    • Products
      • Moz Pro

        Your all-in-one suite of SEO essentials.

      • Moz Local

        Raise your local SEO visibility with complete local SEO management.

      • STAT

        SERP tracking and analytics for enterprise SEO experts.

      • Moz API

        Power your SEO with our index of over 44 trillion links.

      • Compare SEO Products

        See which Moz SEO solution best meets your business needs.

      • Moz Data

        Power your SEO strategy & AI models with custom data solutions.

      NEW Keyword Suggestions by Topic
      Moz Pro

      NEW Keyword Suggestions by Topic

      Learn more
    • Free SEO Tools
      • Domain Analysis

        Get top competitive SEO metrics like DA, top pages and more.

      • Keyword Explorer

        Find traffic-driving keywords with our 1.25 billion+ keyword index.

      • Link Explorer

        Explore over 40 trillion links for powerful backlink data.

      • Competitive Research

        Uncover valuable insights on your organic search competitors.

      • MozBar

        See top SEO metrics for free as you browse the web.

      • More Free SEO Tools

        Explore all the free SEO tools Moz has to offer.

      What is your Brand Authority?
      Moz

      What is your Brand Authority?

      Check yours now
    • Learn SEO
      • Beginner's Guide to SEO

        The #1 most popular introduction to SEO, trusted by millions.

      • SEO Learning Center

        Broaden your knowledge with SEO resources for all skill levels.

      • On-Demand Webinars

        Learn modern SEO best practices from industry experts.

      • How-To Guides

        Step-by-step guides to search success from the authority on SEO.

      • Moz Academy

        Upskill and get certified with on-demand courses & certifications.

      • SEO Q&A

        Insights & discussions from an SEO community of 500,000+.

      Unlock flexible pricing & new endpoints
      Moz API

      Unlock flexible pricing & new endpoints

      Find your plan
    • Blog
    • Why Moz
      • Small Business Solutions

        Uncover insights to make smarter marketing decisions in less time.

      • Agency Solutions

        Earn & keep valuable clients with unparalleled data & insights.

      • Enterprise Solutions

        Gain a competitive edge in the ever-changing world of search.

      • The Moz Story

        Moz was the first & remains the most trusted SEO company.

      • Case Studies

        Explore how Moz drives ROI with a proven track record of success.

      • New Releases

        Get the scoop on the latest and greatest from Moz.

      Surface actionable competitive intel
      New Feature

      Surface actionable competitive intel

      Learn More
    • Log in
      • Moz Pro
      • Moz Local
      • Moz Local Dashboard
      • Moz API
      • Moz API Dashboard
      • Moz Academy
    • Avatar
      • Moz Home
      • Notifications
      • Account & Billing
      • Manage Users
      • Community Profile
      • My Q&A
      • My Videos
      • Log Out

    The Moz Q&A Forum

    • Forum
    • Questions
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

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

    1. Home
    2. SEO Tactics
    3. Intermediate & Advanced SEO
    4. Redirecting index.html to the root

    Moz Q&A is closed.

    After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.

    Redirecting index.html to the root

    Intermediate & Advanced SEO
    8
    11
    48632
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with question 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 7
      • Nikos-Kor
        Nikos-Kor @StreamlineMetrics last edited by

        @streamlinemetrics this worked for my site Finbit Solutions, too! Thank you very much!

        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
          • wideangle
            wideangle @StreamlineMetrics last edited by

            works, thank you!

            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
              • 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
                • 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
                  • 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
                    • 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 Nikos-Kor 5 Replies 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 4
                        • 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
                          • 1 / 1
                          • First post
                            Last post

                          Got a burning SEO question?

                          Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.


                          Start my free trial


                          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.

                          • See all categories

                          Related Questions

                          • NeatIT

                            6 .htaccess Rewrites: Remove index.html, Remove .html, Force non-www, Force Trailing Slash

                            i've to give some information about my website Environment 1. i have static webpage in the root. 2. Wordpress installed in sub-dictionary www.domain.com/blog/ 3. I have two .htaccess , one in the root and one in the wordpress
                            folder. i want to www to non on all URLs Remove index.html from url Remove all .html extension / Re-direct 301 to url
                            without .html extension Add trailing slash to the static webpages / Re-direct 301 from non-trailing slash Force trailing slash to the Wordpress Webpages / Re-direct 301 from non-trailing slash Some examples domain.tld/index.html >> domain.tld/ domain.tld/file.html >> domain.tld/file/ domain.tld/file.html/ >> domain.tld/file/ domain.tld/wordpress/post-name >> domain.tld/wordpress/post-name/ My code in ROOT htaccess is <ifmodule mod_rewrite.c="">Options +FollowSymLinks -MultiViews RewriteEngine On
                            RewriteBase / #removing trailing slash
                            RewriteCond %{REQUEST_FILENAME} !-d
                            RewriteRule ^(.*)/$ $1 [R=301,L] #www to non
                            RewriteCond %{HTTP_HOST} ^www.(([a-z0-9_]+.)?domain.com)$ [NC]
                            RewriteRule .? http://%1%{REQUEST_URI} [R=301,L] #html
                            RewriteCond %{REQUEST_FILENAME} !-f
                            RewriteCond %{REQUEST_FILENAME} !-d
                            RewriteRule ^([^.]+)$ $1.html [NC,L] #index redirect
                            RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index.html\ HTTP/
                            RewriteRule ^index.html$ http://domain.com/ [R=301,L]
                            RewriteCond %{THE_REQUEST} .html
                            RewriteRule ^(.*).html$ /$1 [R=301,L]</ifmodule> The above code do 1. redirect www to non-www
                            2. Remove trailing slash at the end (if exists)
                            3. Remove index.html
                            4. Remove all .html
                            5. Redirect 301 to filename but doesn't add trailing slash at the end

                            Intermediate & Advanced SEO | | NeatIT
                            0
                          • friendoffood

                            Removing UpperCase URLs from Indexing

                            This search   -  site:www.qjamba.com/online-savings/automotix gives me this result from Google: Automotix online coupons and shopping - Qjamba
                            https://www.qjamba.com/online-savings/automotix
                            Online Coupons and Shopping Savings for Automotix. Coupon codes for online discounts on Vehicles & Parts products. and Google tells me there is another one, which is 'very simliar'.  When I click to see it I get: Automotix online coupons and shopping - Qjamba
                            https://www.qjamba.com/online-savings/Automotix
                            Online Coupons and Shopping Savings for Automotix. Coupon codes for online discounts on Vehicles & Parts products. This is because I recently changed my program to redirect all urls with uppercase in them to lower case, as it appears that all lowercase is strongly recommended. I assume that having 2 indexed urls for the same content dilutes link juice.  Can I safely remove all of my UpperCase indexed pages from Google without it affecting the indexing of the lower case urls?  And if, so what is the best way -- there are thousands.

                            Intermediate & Advanced SEO | | friendoffood
                            0
                          • EndeR-

                            No-index pages with duplicate content?

                            Hello, I have an e-commerce website selling about 20 000 different products. For the most used of those products, I created unique high quality content. The content has been written by a professional player that describes how and why those are useful which is of huge interest to buyers. It would cost too much to write that high quality content for 20 000 different products, but we still have to sell them. Therefore, our idea was to no-index the products that only have the same copy-paste descriptions all other websites have. Do you think it's better to do that or to just let everything indexed normally since we might get search traffic from those pages? Thanks a lot for your help!

                            Intermediate & Advanced SEO | | EndeR-
                            0
                          • Sika22

                            PDF or HTML Page?

                            One of our sales team members has created a 25 page word document as a topical page.  The plan was to make this into an html page with a table of contents.  My thoughts were why not make it a pdf?  Is there any con to using a PDF vs an html page?  If the PDF was properly optimized would it perform just as well?  The goal is to have folks click back to our products and hopefully by after reading about how they work.

                            Intermediate & Advanced SEO | | Sika22
                            0
                          • co.mc

                            When should you redirect a domain completely?

                            We moved a website over to a new domain name. We used 301 redirects to redirect all the pages individually (around 150 redirects). So my question is, when should we just kill the old site completely and just redirect (forward/point) the old domain over to the new one?

                            Intermediate & Advanced SEO | | co.mc
                            0
                          • Seamoose

                            301 Redirection and apostrophes in URLs

                            Hi I am experiencing trouble getting any redirects with apostrophes in the URLs to 301 redirect in order to eliminate 404 errors. I have tried replacing the instance of the apostrophe in the source URL field to %27 and variations of this but to no avail. The site is a wordpress site (the old URLS are legacies from the old Business Catalyst site) and I am using the redirection plug in. I have gone into some detail with a helpful soul here http://wordpress.org/support/topic/how-to-deal-with-apostrophes-in-source-url but unfortunately to no result. If anyone has any idea how to solve this puzzle I would be grateful for the help. Example: http://www.tesselaars.com/blog/Inside_Flowers/post/Online_Marketing_for_Florists_Part_1%E2%80%93_A_Website_You_Won%27t_Regret/

                            Intermediate & Advanced SEO | | Seamoose
                            0
                          • bloomnation

                            DNS or 301 Website Redirect

                            We are running a marketplace site, so we have thousands of vendors selling their products on our site. Each vendor has a Profile page and we are soon to launch a premium store-front that is white label. Many of these vendors will want to point a custom url to their premium store-front (which is a sub domain of the marketplace) and we are trying to get an understanding of how we should instruct them to point their url in a way that will give the main marketplace site the seo juice. We also want to understand what will show up in the address bar.  Will it be their url or our sub domain? Will any of the marketplace seo juice boost their url local listing status?

                            Intermediate & Advanced SEO | | bloomnation
                            0
                          • coremediadesign

                            Login redirect 302

                            Ok - anyone knows what to do with the temporary redirect to the login page? In our e-commerce system we have a checkout page, which requires user to be logged in - if they are not, we redirect them to the login page using simple php header("Locaiton: url"). This however has been found as a Warning as it's a temporary redirect. I can't really put there permanent redirect for obvious reasons so if someone could give me some clue on this situation that would be much appreciated.

                            Intermediate & Advanced SEO | | coremediadesign
                            0

                          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
                          Free SEO Tools
                          • Domain Authority Checker
                          • Link Explorer
                          • Keyword Explorer
                          • Competitive Research
                          • Brand Authority 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 - 2025 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                          • Accessibility
                          • Terms of Use
                          • Privacy

                          Looks like your connection to Moz was lost, please wait while we try to reconnect.