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. Both links with ".html" and without are working , Is that a problem ?

    Both links with ".html" and without are working , Is that a problem ?

    Technical SEO Issues
    4 2 147
    • 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.
    • Mohamed_Samer
      Mohamed_Samer last edited by

      Default format of my url ending with ".html" , I know it's not a problem .. But both links with ".html" and without are working , Is that critical problem or not ? and how to solve it ?

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

        Hi Mohamed,

        This is an important issue. By leaving both versions of the pages up, you run the risk of having it indexed twice and possibly suffer from duplicate content penalties.

        There are a couple ways to fix it, but the easiest would be add a canonical meta tag to the page that points to the version your site should be using

        **for no extension**

        or

        **with the extension**

        The other way would be to modify your .htaccess file in your root directory to forward all traffic to whichever version you are using.

        To force removal of the extension you could do this

        RewriteEngine On
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^([^.]+)$ $1.html [L,NC,R=301]

        To force extension you could do this

        RewriteEngine On
        RewriteCond %{REQUEST_URI} !^..html$
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.
        )$ $1.html [L,R=301]

        The htaccess should work on most host but if I remember correctly GoDaddy has some special requirements. Check with them if you are using them as a host.

        Hope this helps,

        Don

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

          Thanks a lot ^_^ , But i need some help to apply this since i'm not developer

          I already have canonical tag made by our developers but i don't know if it work properly , How could i know ?

          I'm still getting duplicate content reports

          I'll state the situation for you

          www.example.com/somepage.html (site main format)

          rel="canonical" for this page is = http://www.example.com/somepage.html

          www.example.com/somepage (duplicate)

          rel="canonical" for this page is = http://www.example.com/somepage

          www.example.com/somepage/ (another duplicate)

          rel="canonical" for this page is = http://www.example.com/somepage/

          Is that right or not ?

          and how can i measure if google see that as duplicate or not ?

          Thanks 🙂

          donford 1 Reply Last reply Reply Quote 1
          • donford
            donford @Mohamed_Samer last edited by

            If the canonical tag is on the page, despite the fact the page loads in either version only the one that you have in your canonical tag will be indexed.

            As far the Moz reports these are not updated minute by minute, to see if the canonical tag has fixed the problem in Moz's reports you'll have to wait till they do their next crawl (once a week). You may also use Google's Webmaster and ask for a re-crawl after you made changes.

            Hope that helps,

            Don

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            • Are links still considered reciprocal if the link from one website is rel="nofollow" and the other isnt ?
              MattRoney
              MattRoney
              1
              5
              226

            • "Site:" without Homepage, Why?
              bettingexchange
              bettingexchange
              0
              7
              90

            • How Google can interpret all "hreflag" links into HTML code
              0
              1
              92

            • Does using data-href="" work more effectively than href="" rel="nofollow"?
              Everett
              Everett
              0
              3
              18.1k

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

            • Domain with or without "www"
              RyanKent
              RyanKent
              0
              4
              1.7k

            • What should i do with the links for "Login", "Register", "My Trolley" links on every page.
              gmellak
              gmellak
              0
              2
              808

            • Should I use a "-", ":", or "|" in the title tag?
              CPU
              CPU
              0
              3
              826

            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