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. .html extension

    .html extension

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

      My new client's original web developer set up many pages with .html extensions.  My plan is to turn most of these into php pages.  Also, I think the .html extension displaying in the browser is just ugly so I want to drop the .html extension from those pages that remain.  I know how to do this with .htaccess, but my question is should I 301 redirect all the .html pages to the page without an extension.  (For example, should I redirect www.example.com/page.html to www.example.com/page)

      I don't know how many, in any, links there are out there to these pages, but I'm guessing not many.  I'm sure it's not that big a deal but I was wondering if it would be worth the time to do that for the pages I change.

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

        Absolutely! You can do a blanket "301 any page with .html at the end to the same page without it" rule with .htaccess to save you time and energy once you've done your renaming process.

        This neat little bit of code (found at http://stackoverflow.com/questions/5730092/how-to-remove-html-from-url) should do the trick nicely.

        <code>RewriteEngineOnRewriteCond%{REQUEST_FILENAME}!-f
        RewriteCond%{REQUEST_FILENAME}!-d
        RewriteRule^(.*)\.html$ /$1 [L,R=301]</code>
        
        1 Reply Last reply Reply Quote 2
        • Mattymar
          Mattymar last edited by

          Great! I think I'll give that a whirl.

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

            http://www.seomofo.com/wordpress/seo-friendly-permalinks.html

            http://yoast.com/fixed-category-subpage-titles-and-a-fix-in-permalink-redirect-plugin/

            http://yoast.com/wordpress-seo-url-permalink/

            Hope this helps,

            Tom

            Mattymar 1 Reply Last reply Reply Quote 0
            • Mattymar
              Mattymar @BlueprintMarketing last edited by

              Thanks Thomas but this site only uses wordpress for the blog.  The rest of the site is what I'm concerned with right now.

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              • Vertical pip in HTML
                jasongmcmahon
                jasongmcmahon
                1
                6
                48

              • Website Redesign / Switching CMS / .aspx and .html extensions question
                NielsB
                NielsB
                1
                5
                553

              • Rel="canonical" of .html/ to .html
                irvingw
                irvingw
                0
                3
                154

              • Removing .html extension from url? Benefit for SEO?
                Edgar-Cerecerez
                Edgar-Cerecerez
                0
                8
                22.2k

              • Duplicate content issue index.html vs non index.html
                KaneJamison
                KaneJamison
                0
                10
                1.7k

              • True HTML
                Ideas-Money-Art
                Ideas-Money-Art
                0
                3
                324

              • Basic SEO HTML
                jennita
                jennita
                0
                4
                603

              • Php to html - change in extension
                seoug_2005
                seoug_2005
                1
                9
                1.5k

              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