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.
    • ClickConsult
      ClickConsult last edited by

      Hi Shaz,

      I'm guessing the parameter displays no alternative content, it's simply there for tracking, right?

      If so, the canonical tag should simply be added to http://www.mysite.com/products.php

      You can also set how you want Google to interact with parameters via Google Webmaster Tools.

      Good luck!

      marcinlejman shaz_lhr 3 Replies Last reply Reply Quote 1
      • Keszi
        Keszi last edited by

        Hi Shaz,

        When you are loading http://www.mysite.com/products.php?ref=12345, you are basically loading http://www.mysite.com/products.php.

        In order to resolve the duplicate content issue for each product page you could insert a canonical pointing to itself OR you could eliminate the duplicates by adding the affiliate parameters into Google Webmaster Tools -> Site Configuration -> URL parameters. This way you will tell Google what that specific parameter is.

        Or you could use both (if it is a large website, it is advised to do so).

        I hope that helped,

        Istvan

        1 Reply Last reply Reply Quote 2
        • 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
                            • Rel Canonical help
                              TeamacPaints
                              TeamacPaints
                              0
                              3
                              90

                            • Canonical tag?
                              KarlBantleman
                              KarlBantleman
                              0
                              4
                              209

                            • Rel canonical tag back to the same page the tag is on?
                              Dr-Pete
                              Dr-Pete
                              0
                              7
                              7.1k

                            • Canonical tags
                              RyanKent
                              RyanKent
                              0
                              6
                              525

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

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

                            • Canonical URL tags help I am not sure what this is
                              Dr-Pete
                              Dr-Pete
                              0
                              8
                              553

                            • Rel canonical tag
                              sjrh43
                              sjrh43
                              0
                              4
                              341

                            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

                            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