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. How can I prevent duplicate content between www.page.com/ and www.page.com

    How can I prevent duplicate content between www.page.com/ and www.page.com

    Technical SEO Issues
    4 3 536
    • 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.
    • onlineexpression
      onlineexpression last edited by

      SEOMoz's recent crawl showed me that I had an error for duplicate content and duplicate page titles.

      This is a problem because it found the same page twice because of a '/' on the end of one url.

      e.g. www.page.com/ vs. www.page.com

      My question is do I need to be concerned about this. And is there anything I should put in my htaccess file to prevent this happening.

      Thanks!
      Karl

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

        Hi there,

        This should solve your problem

         <code>#removes trailing slash
                 RewriteCond %{REQUEST_FILENAME} !-f
                 RewriteCond %{REQUEST_FILENAME} !-d
                 RewriteCond %{HTTP_HOST} !^\.localhost$ [NC]
                 RewriteRule ^(.+)/$ http://%{HTTP_HOST}$1 [R=301,L]</code>
        

        If you wish to redirect from non-trailing slash to trailing slash,

        let me you know and I'll send you htaccess for that
        

        Kind regards

        
        Bojan
        1 Reply Last reply Reply Quote 0
        • Catalyste
          Catalyste last edited by

          Yes you should adress this problem. Put something like this in your .htaccess :

          Options +FollowSymLinks
          RewriteEngine On
          
          # REDIRECT to canonical url
          RewriteCond %{HTTP_HOST} ^mysite\.com [NC]
          RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]
          
          
          1 Reply Last reply Reply Quote 0
          • onlineexpression
            onlineexpression last edited by

            Thanks a lot for your quick replys. I have it sorted now 🙂

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            • Page Rank Being Split Between www.website.com and http://website.com
              DmitriiK
              DmitriiK
              0
              2
              25

            • Duplicate Page Content for www and non-www. Help!
              Andy.Drinkwater
              Andy.Drinkwater
              0
              7
              486

            • If I want clean up my URLs and take the "www.site.com/page.html" and make it "www.site.com/page" do I need a redirect?
              Booj
              Booj
              0
              4
              113

            • Ideally should a 301 or 302 redirect be used from https://www.site.com to http://www.site.com? Is there a valid reason to use a 302 in this situation or would using a 301 have any negative impact on seo?
              Unity
              Unity
              0
              2
              317

            • Home Page .index.htm and .com Duplicate Page Content/Title
              TOMMarketingLtd.
              TOMMarketingLtd.
              0
              6
              1.6k

            • To 301 redirect or not to 301 redirect? duplicate content problem www.domain.com and www.domain.com/en/
              Chris-CA
              Chris-CA
              0
              5
              456

            • How do I stop www.mysite.com/ showing as a duplicate of www.mysite.com
              Dr-Pete
              Dr-Pete
              0
              5
              509

            • I am trying to correct error report of duplicate page content. However I am unable to find in over 100 blogs the page which contains similar content to the page SEOmoz reported as having similar content is my only option to just dlete the blog page?
              evolvingSEO
              evolvingSEO
              0
              4
              344

            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