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. On-Page / Site Optimization
    4. Canonical tag help

    Canonical tag help

    On-Page / Site Optimization
    13 7 777
    • 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.
    • marcinlejman
      marcinlejman @ClickConsult last edited by

      Hi,

      I'm afraid your answer is not entirely correct.

      Let me quote directly from the source:

      "If Google knows that these pages have the same content, we may index only one version for our search results. Our algorithms select the page we think best answers the user's query. Now, however, users can specify a canonical page to search engines by adding a **** element with the attribute rel="canonical" to the **** section of the non-canonical version of the page. Adding this link and attribute lets site owners identify sets of identical content and suggest to Google: "Of all these pages with identical content, this page is the most useful. Please prioritize it in search results."

      DougRoberts 1 Reply Last reply Reply Quote 0
      • DougRoberts
        DougRoberts @marcinlejman last edited by

        But you'd still want to add a rel=canonical on the products.php page so that all "versions" that get indexed with a referrer parameter are pointing to the vanilla products.php as the canonical version?

        1 Reply Last reply Reply Quote 0
        • shaz_lhr
          shaz_lhr @ClickConsult last edited by

          Yes, the parameter is there only to track the affiliate

          Thanks,

          shaz

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

            I want to expand on what I think Istvan was trying to say. First, the canonical on "products.php" will consolidate all of the affiliate IDs. That should be a perfectly valid solution here.

            The only warning is whether you have other IDs on that page that drive different product views. If it's just one single product page, then the canonical is great here. If, however, you have something like:

            http://www.mysite.com/products.php?prod=1&ref=12345

            http://www.mysite.com/products.php?prod=2&ref=12345

            ...where "prod=" (or something like it) represents separate products, then a canonical tag to "/products.php" would collapse ALL of your product pages into one. That's certainly not what you want. So, it does depend a lot on the details. In that case, the "?prod=1", etc. version would actually be the canonical version (you'd have to set the tag dynamically).

            Keszi shaz_lhr 2 Replies Last reply Reply Quote 1
            • Keszi
              Keszi @Dr-Pete last edited by

              Thank you Dr. Pete 🙂

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

                Thanks Peter for the explanation. We only have ref ID so we should be fine by adding canonical tag to only products.php.

                All of you have been really helpful.

                Regards,

                shahzad

                1 Reply Last reply Reply Quote 0
                • shaz_lhr
                  shaz_lhr @ClickConsult last edited by

                  Hi,

                  I've written some rewrite rules in htaccess file to make url names more readable like

                  RewriteCond %{REQUEST_URI} (.)(simple-url)$
                  RewriteRule (.
                  )$ url-with-extension.php

                  Should i specify the "simple-url" or "url-with-extension.php" (urls from above example) in canonical tag as proper url ?

                  Thanks,

                  shaz

                  Dr-Pete shaz_lhr 2 Replies Last reply Reply Quote 0
                  • Dr-Pete
                    Dr-Pete @shaz_lhr last edited by

                    Be careful changing your sitewide URL structure, but if you're going to show users the "url-with-extension" version, make that canonical. It's dangerous to use one version for users and another for search, and people will start linking to the one they see.

                    I'd also 301-redirect the rewrite (add "[R=301]" to the end of the rewrite rule) and link to it internally. If you have one "canonical" version for bots and another for visitors, you'll end up with a mess.

                    1 Reply Last reply Reply Quote 0
                    • shaz_lhr
                      shaz_lhr @shaz_lhr last edited by

                      Thanks Peter, I've added those urls to canonical tags which are actually being viewed by users i.e simple-url from above mentioned rewrite rule . So now same url is being used both for user and search engine bots

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

                        This post is deleted!
                        1 Reply Last reply Reply Quote 0
                        • 1 / 1
                        • First post
                          Last post
                        • Tag Clouds in Google Despite Canonical Links for Single Tags/Articles
                          CopBlaster.com
                          CopBlaster.com
                          0
                          2
                          121

                        • Canonical tags in the body?
                          Whittie
                          Whittie
                          0
                          4
                          1.8k

                        • How do I remove a Canonical URL Tag?
                          evolvingSEO
                          evolvingSEO
                          0
                          7
                          1.8k

                        • Canonical tag?
                          KarlBantleman
                          KarlBantleman
                          0
                          4
                          209

                        • How to add canonical tag
                          ge0173400
                          ge0173400
                          1
                          3
                          2.9k

                        • Canonical Help?
                          Saijo.George
                          Saijo.George
                          0
                          2
                          586

                        • Rel canonical tag
                          sjrh43
                          sjrh43
                          0
                          4
                          341

                        • Canonical tag for home page
                          JarnoNijzing
                          JarnoNijzing
                          0
                          3
                          3.9k

                        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