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. On-Page / Site Optimization
    4. Is it ok to point internal links to index.html home page rather than full www

    Is it ok to point internal links to index.html home page rather than full www

    On-Page / Site Optimization
    14 4 1.9k
    • 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.
    • NakulGoyal
      NakulGoyal last edited by

      Yes, you definitely should and when you do that, make sure you do a redirect from www.website.com/index.html to www.website.com You could do that via .htaccess RewriteEngine on RewriteCond %{THE_REQUEST} ^./index.html?\ HTTP/ RewriteRule ^(.)index.html?$ "/$1" [R=301,L]

      Mark_Ginsberg 1 Reply Last reply Reply Quote 4
      • Mark_Ginsberg
        Mark_Ginsberg last edited by

        Ideally, it's best not to have the index.html showing up as well - could be a problem of duplicate content. So I would recommend correcting your internal links to point to www.website.com without the index.html. Generally, you should set up the server so that it strips out the index.html and 301 redirects to the clean domain. However, if you need to keep the index.html live and can't redirect it, at the very least I'd make sure to use a canonical tag on the page pointing to the clean version of the page, www.website.com.

        Let me know if you need me to elaborate further.

        Mark

        Twinbytes Dr-Pete 2 Replies Last reply Reply Quote 3
        • Mark_Ginsberg
          Mark_Ginsberg @NakulGoyal last edited by

          Nakul didn't specify, but the code he gave you is if your site is running on an apache server. Make sure to work with your developers to deal with these issues, and don't try changing your htaccess file on your own - you make major problems for your site very easily.

          NakulGoyal 1 Reply Last reply Reply Quote 2
          • NakulGoyal
            NakulGoyal @Mark_Ginsberg last edited by

            Yes, that's right. Thanks Mark for specifying that .htaccess will only work if you are Apache based.

            1 Reply Last reply Reply Quote 0
            • Twinbytes
              Twinbytes @Mark_Ginsberg last edited by

              Thanks.  You answered my main question.  One other question then from that.  How can I remove the index.html file from the website but still have the main website load?  I believe the index.html file has to be located somewhere for the main page to know where to look.  Right?  I believe if you go to www.twinbytes.ca which is my website, it really looks at www.twinbytes.ca/index.html anyway to get the information to display.  Would I be correct in saying so?  I understand 90% of this, but this whole index.html for the home page thing is a bit confusing.

              Mark_Ginsberg Twinbytes 6 Replies Last reply Reply Quote 0
              • Mark_Ginsberg
                Mark_Ginsberg @Twinbytes last edited by

                Hi Daniel,

                I was a bit confused by this - index.html on your site returns a 404 error. I changed the url to index.htm and then it returns the correct information as a 200.

                Basically, I'm not saying to delete the page index.htm - that is in fact your default page and what the server will show as your homepage. Nakul and I have just been saying to configure the server to strip out the index.htm from the URL and just show twinbytes.ca. Since your site is in fact on an Apache server, you should be able to use the htaccess info that Nakul gave you. But be careful when changing an htaccess file - you can really mess up your site if you don't do it properly. Be sure to make a backup of the file before making any changes or additions to it.

                Even though your file is index.htm, the line in Nakul's code should have you covered due to the regular expression.

                Mark

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

                  Thanks.  Sorry I meant to say index.htm.  Thanks you both for making this very clear.  I've already created a .htaccess file to fix my twin domain issue, now I just have to modify the .htaccess file to include this code.

                  The code unfortunately doesn't seem to work when I upload it.  meaning, when I type in my website address including index.htm the display still says index.htm rather than removing that part.  Am I doing something wrong?  Here's what I have currently in my htaccess file.

                  RewriteEngine On
                  RewriteCond %{HTTP_HOST} !^(www|blog|askdaniel).
                  RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

                  RewriteEngine on RewriteCond %{THE_REQUEST} ^./index.htm?\ HTTP/ RewriteRule ^(.)index.htm?$ "/$1" [R=301,L]

                  1 Reply Last reply Reply Quote 0
                  • Dr-Pete
                    Dr-Pete @Mark_Ginsberg last edited by

                    The 301-redirect that Mark and Nakul discuss is probably your best bet here, but if that's causing you implementation problems, you could use the canonical tag on your home-page (in the section):

                    That will help sweep up any duplicates. It is best to link consistently to the root version, though (without the "index.htm"). FYI, you've got another weird duplicate in Google's index:

                    http://www.twinbytes.ca/index_from_mobile.htm

                    Twinbytes 1 Reply Last reply Reply Quote 1
                    • Mark_Ginsberg
                      Mark_Ginsberg @Twinbytes last edited by

                      could it not be working because you used rewriteengine twice?

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

                        Well, I tried taking out the 2nd instance of RewriteEngine on but i Just get a 500 error now.  I put it back how it was for now.

                        Any other ideas?

                        1 Reply Last reply Reply Quote 0
                        • Twinbytes
                          Twinbytes @Dr-Pete last edited by

                          Thanks.  I was trying a mobile version of the website also at some point.  I will just delete that one for now.

                          I can try your idea but is forwarding from the page itself still good for SEO?

                          1 Reply Last reply Reply Quote 0
                          • Mark_Ginsberg
                            Mark_Ginsberg @Twinbytes last edited by

                            Try this - of course take what you need from it - source is here - http://stackoverflow.com/questions/6059920/removing-index-html-from-url-and-adding-www-with-one-single-301-redirect Options +FollowSymlinks -MultiViews RewriteEngine on RewriteCond %{HTTP_HOST} !^www. [NC] RewriteCond %{REQUEST_URI} ^(./)index.html$ [NC] RewriteRule . http://www.%{HTTP_HOST}%1 [R=301,NE,L] RewriteCond %{HTTP_HOST} !^www. [NC] RewriteRule . http://www.%{HTTP_HOST}%{REQUEST_URI} [NE,R=301,L] RewriteCond %{REQUEST_URI} ^(./)index.html$ [NC] RewriteRule . %1 [R=301,NE,L]

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

                              Awesome!  By adding the following code to my .htaccess file, and placing it in my public directory it works.  Didn't work from the root directory which I figured out later.  I think related concerns are solved now.  Now to see how the results show on the next crawl.  🙂

                              RewriteCond %{REQUEST_URI} /index.html?$ [NC]
                              RewriteRule ^(.*)index.html?$ "/$1" [NC,R=301,NE,L]

                              1 Reply Last reply Reply Quote 1
                              • 1 / 1
                              • First post
                                Last post
                              • Home page is ranking higher than internal page?
                                Nigel_Carr
                                Nigel_Carr
                                0
                                2
                                47

                              • When trying to sculpt an internal link structure, is there any point in placing text links to top level pages that are already in the main menu?
                                bittristo
                                bittristo
                                0
                                5
                                51

                              • Understanding why our new page doesn't rank. Internal link structure to blame? + understand canonical pages more.
                                isaac663
                                isaac663
                                0
                                5
                                173

                              • On Brand Queries Google does not shows my home page first instead of it shows internal pages.
                                JaneCopland
                                JaneCopland
                                0
                                5
                                183

                              • Why does the on page report reports a full path link as Cannibalize link?
                                AaronWheeler
                                AaronWheeler
                                0
                                2
                                368

                              • Do anchor links pointing to bottom/top of page count as link?
                                Cyrus-Shepard
                                Cyrus-Shepard
                                0
                                4
                                631

                              • Internal link to the home page
                                ChristopherGlaeser
                                ChristopherGlaeser
                                0
                                4
                                667

                              • Nofollowed internal links from the home page
                                Theo-NL
                                Theo-NL
                                1
                                4
                                1.0k

                              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