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. Avoiding duplicate content/same pages

    Avoiding duplicate content/same pages

    Technical SEO Issues
    8 5 1.1k
    • 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.
    • challen
      challen last edited by

      hi I have been checking through all the Q and A but i i'm still not sure how you get http://www.domain.co.uk/index.html to be just http://www.domain.co.uk/?

      Do you add canonical to the index page to point to the page you prefer and then add a 301 redirect?

      thanks

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

        Yeah, add a rel="canonical" to show what page you want (e.g. www.domain.co.uk") and then setup your .htaccess like:

        RewriteEngine on
        RewriteBase /
        RewriteRule ^index.(htm|html|php) http://www.domain.co.uk/ [R=301,L]

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

          Here is the code. Please add this to your .htaccess file. This will remove both index.php and www/non www canonicalization.

          RewriteEngine onRewriteCond %{HTTP_HOST} ^domain.co.uk [NC] RewriteRule (.*) http://www.domain.co.uk/$1 [L,R=301]

          RewriteEngine OnRewriteBase /RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index.php\ HTTP/RewriteRule ^index.php$ http://www.domain.co.uk/ [R=301,L]

          RewriteCond %{REQUEST_FILENAME} !-f

          RewriteCond %{REQUEST_FILENAME} !-d

          RewriteRule . /index.php [L]

          1 Reply Last reply Reply Quote 0
          • ninjamarketer
            ninjamarketer @perfectweb last edited by

            I don't think he will need the rel canonical as long as the proper redirect code is in place.

            Thoughts??

            perfectweb 1 Reply Last reply Reply Quote 0
            • perfectweb
              perfectweb @ninjamarketer last edited by

              No it is not necessary. I like to add it just in case the .htaccess rules break at any time (e.g. when something else gets updated)

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

                Did the .htaccess information answer your question, or do you still need some more help? I don't know your domain, so it's hard to know if you were able to get it implemented. =]

                challen 1 Reply Last reply Reply Quote 0
                • challen
                  challen @KeriMorgret last edited by

                  hey no it didnt help as the two answers seem to be different.

                  is this right?

                  RewriteEngine on
                  RewriteCond %{REQUEST_FILENAME} !-d
                  RewriteCond %{REQUEST_FILENAME}.html -f
                  RewriteRule ^(.*)$ $1.html

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

                    Hi Challen,

                    The following code should remove all index.html from any page you go to but I recommend you get someone who is comfortable working with .htaccess files since you can do some damage if you don't do thing correct.  Plus not all code in .htaccess files works the same on every server.  So if the code in the other few answer doesn't work and neither does mine, it may be something to do with your host and you may need to check with them.

                    Options +FollowSymLinks
                    RewriteEngine On
                    RewriteCond %{THE_REQUEST} /index.html\ HTTP [NC]
                    RewriteRule (.*)index.html$ /$1 [R=301,L]

                    Casey

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • First post
                      Last post
                    • I have duplicate content but // are causing them
                      ThompsonPaul
                      ThompsonPaul
                      0
                      7
                      62

                    • Duplicate Content/Similar Pages
                      slecinc
                      slecinc
                      0
                      6
                      153

                    • How bad is it to have duplicate content across http:// and https:// versions of the site?
                      RG_SEO
                      RG_SEO
                      0
                      4
                      155

                    • Duplicate content or Duplicate page issue?
                      Kurt_Steinbrueck
                      Kurt_Steinbrueck
                      0
                      2
                      106

                    • Container Page/Content Page Duplicate Content
                      ProductiveEdge
                      ProductiveEdge
                      1
                      4
                      194

                    • Avoiding duplicate content on internal pages
                      BedeFahey
                      BedeFahey
                      0
                      4
                      313

                    • 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

                    • Duplicate Page Title/Page Content Errors return URLs showing strange string of characters
                      RyanKent
                      RyanKent
                      0
                      4
                      590

                    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