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.
    • 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
                          • Understanding why our new page doesn't rank. Internal link structure to blame? + understand canonical pages more.
                            isaac663
                            isaac663
                            0
                            5
                            173

                          • Too many page links warning... but each link has canonical back to main page? Is my page OK?
                            Chris.Menke
                            Chris.Menke
                            0
                            2
                            139

                          • Internal Followed Links and Total Internal Links as 1
                            ChiarynMiranda
                            ChiarynMiranda
                            0
                            3
                            987

                          • Internal Linking - Same page
                            esendex
                            esendex
                            0
                            4
                            794

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

                          • How do I do a 301 Redirect in IIS 7 from http://www.freightmonster.com/index.html to http://freightmonster.com/index.html when I don't have a physical page to redirect?
                            EricaMcGillivray
                            EricaMcGillivray
                            0
                            4
                            1.0k

                          • 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