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. Technical SEO Issues
    4. Internal file extension canonicalization

    Internal file extension canonicalization

    Technical SEO Issues
    5 3 618
    • 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.
    • jg100
      jg100 last edited by

      Ok no doubt this is straightforward, however seem to be finding to hard to find a simple answer; our websites' internal pages have the extension .html. Trying to the navigate to that internal url without the .html extension results in a 404.

      The question is; should a 401 be used to direct to the extension-less url to future proof? and should internal links direct to the extension-less url for the same reason?

      Hopefully that makes sense and apologies for what I believe is a straightforward answer;

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

        I'm about to make a whole lot of assumptions about your website to give this answer, just be aware.

        Your website is built static, using HTML. Hence the .html file extension. If you're seeing websites that don't have file extension, it's most likely they are using content management systems (or have some serious /folder/index.html stuff going on).

        Having a file extension like .html or .aspx or .php is not a bad thing. On websites like yours, it is required (unless you do the above subfolder thing) because it's an actual file the browser is grabbing rather than something being dynamically generated by a CMS. It has nothing to do with future-proofing.

        As for 301'ing non-extension URLs to extention'd ones...well I don't know why you'd need to do that for your type of site.

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

          As nick said, you dont need to do this, but if you are.

          1. REWRITE the new url to the old url, as your webserver needs to know the extention

          2. REDIRECT the old url to the new one, incase you already have links to the old urls, you dont want5 duplicate content

          3. you need to make surer that all internal links point to the new url, you dont want un-necessary redirects as they leak link juice.

          jg100 1 Reply Last reply Reply Quote 0
          • jg100
            jg100 @AlanMosley last edited by

            Thankyou for the replies.

            I will try and clarify what I am trying to get at; apologies in advance for any naivety.

            I understand homepage canonicalization; the confusion revolves around how this applies to internal pages.

            Logically; I am struggling to see how internal pages are any different to a homepage in terms of the need to avoid multiple urls....and thus an extension-less url seemed appropriate. Not too mention the benefit or cleaner urls, easier to link to, remember etc.

            i.e.

            example/abc

            example/abc.html

            example/abc.index.html

            AlanMosley 1 Reply Last reply Reply Quote 0
            • AlanMosley
              AlanMosley @jg100 last edited by

              As above

              example/abc rewrites to example/abc.html

              example/abc.html redirects to example/abc

              and all internal links link to example/abc

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              • Search Console rejecting XML sitemap files as HTML files, despite them being XML
                SearchDeploy
                SearchDeploy
                0
                5
                89

              • Removing extension
                UmarKhan
                UmarKhan
                0
                2
                223

              • Why are these internal pages not showing any internal links?
                MiguelSalcido
                MiguelSalcido
                0
                6
                157

              • Internal link structure, find out if there are any internal links to this page
                RobertFisher
                RobertFisher
                0
                8
                1.2k

              • When doing internal linking back to your home/index file what is the best coding course of action?
                CharlesDaniels
                CharlesDaniels
                0
                7
                109

              • .html extension
                Mattymar
                Mattymar
                0
                5
                213

              • Explain me the SEO impact when a website has more internal link compared to less internal links
                BoniSatani
                BoniSatani
                0
                3
                183

              • Converting files from .html to .php or editing .htaccess file
                donford
                donford
                0
                11
                3.6k

              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