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
            • Getting high priority issue for our xxx.com and xxx.com/home as duplicate pages and duplicate page titles can't seem to find anything that needs to be corrected, what might I be missing?
              Todd_McDonald
              Todd_McDonald
              0
              4
              4.0k

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

            • Moving from www.domain.com/nameofblog to www.domain.com/blog
              cathibanks
              cathibanks
              0
              6
              153

            • 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

            • Why do I get duplicate pages, website referencing the capital version of the url vs the lowercase www.agi-automation.com/Pneumatic-grippers.htm
              TimKelsey
              TimKelsey
              0
              7
              547

            • Duplicate Homepage: www.mysite.com/ and www.mysite.com/default.aspx
              MaryAnneG
              MaryAnneG
              0
              4
              2.3k

            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