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. Rel=canonical

    Rel=canonical

    Intermediate & Advanced SEO
    4 2 63
    • 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.
    • singingtelegramsuk
      singingtelegramsuk last edited by

      My website is built around a template, the hosting site say I can only add code into the body of the webpage not the header, will this be ok for rel=canonical

      If it is my next question is redundant but as there is only one place to put it which urls do I need to place in the code

      http://domain.com, www.domain.com or http://www.domain.com

      the /default.asp option for my website does not seem to exist, so I guess is not relevant

      thanks

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

        rel=canonical needs to either go within the tags or the HTTP header.

        http://googlewebmastercentral.blogspot.co.uk/2013/04/5-common-mistakes-with-relcanonical.html

        singingtelegramsuk 1 Reply Last reply Reply Quote 1
        • singingtelegramsuk
          singingtelegramsuk @MickEdwards last edited by

          Ok that means I can not use it on my main website but I have another hosted elsewhere where I can. So If I add the code in the head section of my web editor which links do I need to include

          http://www.domain.com http://domain.com or www.domain.com  and what is the correct syntax

          I am assuming that my web editor changes 1 of those, but the change shows up on all three, so which is the authoritative page and which pages need to be referenced in the tag

          I read the google article but I think I am more confused than ever

          Thank you

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

            http://www.domain.com is the same as www.domain.com.  http is the protocol in which web pages are formatted and sent and would be part of any "complete" URL.

            So to answer your question, if there are no redirects in place you can choose either the non www or www version for your canonical tags.  However if you are looking to consolidate to a particular version I would look at updating your htaccess file to create a redirect rule from one version to the other.

            #Force non-www to www:
            RewriteEngine on
            RewriteCond %{HTTP_HOST} ^example.com [NC]
            RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301,NC]

            or

            #Force www to non-www:
            RewriteEngine on
            RewriteCond %{HTTP_HOST} ^www.example.com [NC]
            RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]

            1 Reply Last reply Reply Quote 1
            • 1 / 1
            • First post
              Last post
            • Rel=canonical Question
              0
              2
              54

            • What is the difference between link rel="canonical" and meta name="canonical"?
              Ideas-Money-Art
              Ideas-Money-Art
              0
              3
              1.3k

            • Is it ok to add rel=CANONICAL into the desktop version on top of the rel="alternate" Tag (Mobile vs Desktop version)
              Ideas-Money-Art
              Ideas-Money-Art
              0
              3
              172

            • Where to point Rel = Canonical?
              wojkwasi
              wojkwasi
              0
              6
              417

            • Pagination, AJAX, rel=next and previous, rel canonical and meta noindex :)
              Dr-Pete
              Dr-Pete
              0
              4
              6.9k

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

            • Rel Canonical = WHAT
              SEObleu.com
              SEObleu.com
              0
              3
              403

            • <rel canonical="">and Query Strings</rel>
              RyanKent
              RyanKent
              0
              2
              1.6k

            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