Skip to content
    Moz logo Menu open Menu close
    • Products
      • Moz Pro
      • Moz Pro Home
      • Moz Local
      • Moz Local Home
      • STAT
      • Mozscape API
    • Free SEO Tools
      • Competitive Research
      • Link Explorer
      • Keyword Explorer
      • Domain Analysis
      • 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 Tools

        The essential SEO toolset: keyword research, link building, site audits, page optimization, rank tracking, reporting, and more.

        Learn more
        Try Moz Pro free
        Illustration of Moz Pro
      • Moz Local

        Complete Local SEO Management

        Raise your local SEO visibility with easy directory distribution, review management, listing updates, and more.

        Learn more
        Check my presence
        Illustration of Moz Local
      • STAT

        Enterprise Rank Tracking

        SERP tracking and analytics for SEO experts, STAT helps you stay competitive and agile with fresh insights.

        Learn more
        Book a demo
        Illustration of STAT
      • Mozscape API

        The Power of Moz Data via API

        Power your SEO with the proven, most accurate link metrics in the industry, powered by our index of trillions of links.

        Learn more
        Get connected
        Illustration of Mozscape API
      • Compare SEO Products
    • Free SEO Tools
      • Competitive Research

        Competitive Intelligence to Fuel Your SEO Strategy

        Gain intel on your top SERP competitors, keyword gaps, and content opportunities.

        Find competitors
        Illustration of Competitive Research
      • Link Explorer

        Powerful Backlink Data for SEO

        Explore our index of over 40 trillion links to find backlinks, anchor text, Domain Authority, spam score, and more.

        Get link data
        Illustration of Link Explorer
      • Keyword Explorer

        The One Keyword Research Tool for SEO Success

        Discover the best traffic-driving keywords for your site from our index of over 500 million real keywords.

        Search keywords
        Illustration of Keyword Explorer
      • Domain Analysis

        Free Domain SEO Analysis Tool

        Get top competitive SEO metrics like Domain Authority, top pages, ranking keywords, and more.

        Analyze domain
        Illustration of Domain Analysis
      • MozBar

        Free, Instant SEO Metrics As You Surf

        Using Google Chrome, see top SEO metrics instantly for any website or search result as you browse the web.

        Try MozBar
        Illustration of MozBar
      • More Free SEO Tools
    • Learn SEO
      • Beginner's Guide to SEO

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

        Read the Beginner's Guide
      • How-To Guides

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

        See All SEO Guides
      • SEO Learning Center

        Broaden your knowledge with SEO resources for all skill levels.

        Visit the Learning Center
      • Moz Academy

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

        Explore the Catalog
      • On-Demand Webinars

        Learn modern SEO best practices from industry experts.

        View All Webinars
      • SEO Q&A

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

        Find SEO Answers
      The Impact of Local Business Reviews
      SEO Industry Report

      The Impact of Local Business Reviews

      Learn more
    • Blog
    • Why Moz
      • Small Business Solutions

        Uncover insights to make smarter marketing decisions in less time.

        Grow Your Business
      • The Moz Story

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

        Read Our Story
      • Agency Solutions

        Earn & keep valuable clients with unparalleled data & insights.

        Drive Client Success
      • Case Studies

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

        See What's Possible
      • Enterprise Solutions

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

        Scale Your SEO
      • New Releases

        Get the scoop on the latest and greatest from Moz.

        See What’s New
      Surface actionable competitive intel
      New Feature: Moz Pro

      Surface actionable competitive intel

      Learn More
    • Log in
      • Moz Pro
      • Moz Local
      • Moz Local Dashboard
      • Mozscape API
      • Mozscape 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

    Redirecting index.html to the root

    Intermediate & Advanced SEO
    8
    11
    45186
    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 5
      • 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 3
                        • 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

                          • nhhernandez

                            Redirecting Pages During Site Migration

                            Hi everyone, We are changing a website's domain name. The site architecture will stay the same, but we are renaming some pages. How do we treat redirects? I read this on Search Engine Land: The ideal way to set up your redirects is with a regex expression in the .htaccess file of your old site. The regex expression should simply swap out your domain name, or swap out HTTP for HTTPS if you are doing an SSL migration. For any pages where this isn’t possible, you will need to set up an individual redirect. Make sure this doesn’t create any conflicts with your regex and that it doesn’t produce any redirect chains. Does the above mean we are able to set up a domain redirect on the regex for pages that we are not renaming and then have individual 1:1 redirects for renamed pages in the same .htaccess file? So have both? This will not conflict with the regex rule?

                            Intermediate & Advanced SEO | | nhhernandez
                            0
                          • Jamesmcd03

                            Redirect Juice?

                            Hello all! I have a partner site that is linking their product page (step 1) to our product page (step 2) and then we instantly forward them to our shopping cart page (step 3) with that product added. Will my product page (step 2) get the SEO juice from our partners link (step 1) even though we instantly forward to our shopping cart page (step 3)? Curious about ways to technically do this correctly. Thank you!

                            Intermediate & Advanced SEO | | Jamesmcd03
                            0
                          • android_lyon

                            303 redirect

                            Hi, 303 redirect is a good thing or not ? I have a homepage in 2 languages FR and EN > mywebsite.com/fr/ and mywebsite.com/en/. A 303 redirect is on mywebsite.com to mywebsite.com/fr/. Thanks D.

                            Intermediate & Advanced SEO | | android_lyon
                            0
                          • stassaf

                            Canonical OR redirect

                            Hi, i've a site about sport which cover matches. for each match i've a page. last week there was a match between: T1 v T2 so a page was created: www.domain.com/match/T1vT2   - Page1 this week T2 host T1, so there's a new page www.domain.com/match/T2vT1   - Page2 each page has a unique content with Authorship, but the URL, Title, Description, H1 look very similar cause the only difference is T2 word before T1. though Page2 is available for a few days, on site links & sitemap, for the search query "T2 T1 match" Page1 appears on the SERP (high location). of course i want Page2 to be on SERP for the above query cause it's the relevant match. i even don't see Page2 anywhere on the SERP and i think it wasn't indexed. Questions: 1. do you think google see both pages as duplicated though the content is different? 2. is there a difference when you search for T1 vs T2 OR T2 vs T1 ? 3. should i redirect 301 Page1 to Page2? consider that all content for Page1 and the Authorship G+ will be lost. 4. should i make rel=canonical on Page1 to Page2? 5. should i let google sort it out? i know it's a long one, thanks for your patience. Thanks, Assaf

                            Intermediate & Advanced SEO | | stassaf
                            0
                          • SEO-Pump.com

                            Encoding Apostrophes in HTML

                            One question I have recently been pondering is that the use of apostrophes in ALT attributes and anchor text seems to cause some erratic results from the 'Fetch as BingBot' tool...  GWT doesn't color code the results so i only notice it with BingBot, although i can't necessarily tell that it causes any negative effects.  My rankings on Bing are erratic though so who knows... Should I encode apostrophes as ' when i use them in html?  Or will it not really matter?

                            Intermediate & Advanced SEO | | SEO-Pump.com
                            0
                          • Chammy

                            How to decide on which site to 301 redirect

                            Hi there I'd like your opinions please! My client currently has their website at not-very-good-url.it which has a really good link profile they also have duplicate sites at: much-better-brand-name-url.it and much-better-brand-name-url.com but both these other sites have only a handful of links in. How important do you think a better brand url is? And therefore do you think it would be better to 301 to a better brand URL and take the risk that the link profile will get hit? Or leave the main site where it is and 301 the other two to it? Many thanks

                            Intermediate & Advanced SEO | | Chammy
                            0
                          • SandraMoZ

                            Undo a 301 redirect

                            Hi there, 4 months ago I have done a redirect from one domain to another. Now, after about 120 days I have just a few results from the old domain indexed. The problem is that I believe that the old domain name had a really big impact on rankings, as it had the main keyword in the domain name. I'm wondering now if I could restore the old domain just by taking out the 301 instruction and how will search engines react. Do you have any studies on that? Would it be possible? Matt Cutts himself did it with his own domain, but he doesn't talk specifically on the effect of the rankings: http://www.thedotcomblog.com/seo/redirects-after-change-in-domain-name Thanks in advance for any help,

                            Intermediate & Advanced SEO | | SandraMoZ
                            0
                          • ttb

                            Google indexing issue?

                            Hey Guys, After a lot of hard work, we finally fixed the problem on our site that didn't seem to show Meta Descriptions in Google, as well as "noindex, follow" on tags. Here's my question: In our source code, I am seeing both Meta descriptions on pages, and posts, as well as noindex, follow on tag pages, however, they are still showing the old results and tags are also still showing in Google search after about 36 hours. Is it just a matter of time now or is something else wrong?

                            Intermediate & Advanced SEO | | ttb
                            0
                          Moz logo
                          • Contact
                          • Community
                          • Free Trial
                          • Terms & Privacy
                          • Jobs
                          • Help
                          • News & Press
                          • Mozcon
                          © 2021 - 2023 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.

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