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. Intermediate & Advanced SEO
    4. Canonical url question

    Canonical url question

    Intermediate & Advanced SEO
    8 5 182
    • 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.
    • constructionhelpline
      constructionhelpline last edited by

      i just search seomoz tooll

      it say duplicate content for

      www.mysite.com

      and

      www.mysite.com/index.php

      should i use canonical url for this ?

      is yes then

      is this right ?

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

        This is a great question. Yes, you should use a canonical tag. But, I would suggest that your canonical tag needs to be:

        Notice the addition of the '/"

        THe, I would also make sure that these URLs produce 301 status codes when going through your server:

        http://www.mysite.com

        http://mysite.com

        http://mysite.com/

        This is very important so as not to fragment your link profile and also not to produce massive amounts (potentially) of duplicate content in Google and other search engines.

        Hope that helps!

        Dana

        SEOAndy constructionhelpline Dr-Pete 3 Replies Last reply Reply Quote 2
        • SEOAndy
          SEOAndy @danatanseo last edited by

          In addition to those 301 rules stick this in your htacess file

          DirectoryIndex index.php index.html site-down.php

          it tells the browser and bots which page is the default for your folders and root.

          Also ensure your non-www forward to www. using this code

          RewriteEngine On
          RewriteCond %{HTTP_HOST} !^www.
          RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

          1 Reply Last reply Reply Quote 1
          • constructionhelpline
            constructionhelpline @danatanseo last edited by

            now another question about /

            for this page

            www.mysite.com/subpage.php

            0r

            SEOAndy 1 Reply Last reply Reply Quote 0
            • MoosaHemani
              MoosaHemani last edited by

              I mean canonical is not a bad idea but my suggestion was to use 301 redirection from all different forms of domain URL to your prefered version so that all juice that you have on different URLs can transfer to the preferred version and at the same time visitors also redirect to the URL version you want....

              SEOAndy 1 Reply Last reply Reply Quote 0
              • SEOAndy
                SEOAndy @constructionhelpline last edited by

                no trailing slash where you've got say .php or .html at the end

                1 Reply Last reply Reply Quote 1
                • SEOAndy
                  SEOAndy @MoosaHemani last edited by

                  thats why i said the bit about using non-www in htaccess too

                  1 Reply Last reply Reply Quote 0
                  • Dr-Pete
                    Dr-Pete @danatanseo last edited by

                    Yeah, I think canonical is fine for "index.php" variants. One important addition, though. Check your internal link structure. Many sites link to "index.php" via their "Home" link or logo. I'd suggest changing that to an absolute URL or just "/". That way, you're not creating the non-canonical version in the first place.

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • First post
                      Last post
                    • Google Only Indexing Canonical Root URL Instead of Specified URL Parameters
                      Nitruc
                      Nitruc
                      0
                      3
                      57

                    • Canonicals question ref canonicals pointing to redundant urls
                      AndyMacLean
                      AndyMacLean
                      0
                      4
                      99

                    • Canonical URL & sitemap URL mismatch
                      LynnPatchett
                      LynnPatchett
                      0
                      2
                      612

                    • Followup question to rand(om) question: Would two different versions (mobile/desktop) on the same URL work well from an SEO perspective and provide a better overall end-user experience?
                      retailgeek
                      retailgeek
                      0
                      2
                      202

                    • Blog URL Canonical
                      Dr-Pete
                      Dr-Pete
                      0
                      10
                      209

                    • Canonical URLs and Sitemaps
                      379seo
                      379seo
                      0
                      7
                      12.7k

                    • To "Rel canon" or not to "Rel canon" that is the question
                      Dr-Pete
                      Dr-Pete
                      0
                      10
                      728

                    • Canonical Tag - Question
                      AlanMosley
                      AlanMosley
                      0
                      10
                      1.0k

                    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