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. Using http: shorthand inside canonical tag ("//" instead of "http:") can cause harm?

    Using http: shorthand inside canonical tag ("//" instead of "http:") can cause harm?

    Technical SEO Issues
    5 3 425
    • 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.
    • Kung_fu_Panda
      Kung_fu_Panda last edited by

      HI,

      I am planning to launch a new site, and shortly after to move to HTTPS. to save the need to change over 5,000 canonical tags in pages the webmaster suggested we implement inside the rel canonical "//" instead of the absolute path, would that do any damage or be a problem?

      oranges-south-dakota" />

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

        Hi Po,

        No, you can not or should not use "relative" paths in the URL. They are not properly indexed you should use the absolute path.

        Ref: Google: https://googlewebmastercentral.blogspot.com/2013/04/5-common-mistakes-with-relcanonical.html

        You can use parameters in ASP or PHP to get the path for you.
        PHP example: http://stackoverflow.com/questions/6768793/get-the-full-url-in-php
        ASP example: http://stackoverflow.com/questions/567590/asp-net-absolute-path-of-a-url

        Hope this helps,

        Don

        Mobilio 1 Reply Last reply Reply Quote 0
        • Mobilio
          Mobilio @donford last edited by

          Don,

          this isn't relative path. This is "protocol free". So if domain is blah.com HTTP page will have canonical as http://blah.com and HTTPS page will have canonical as https://blah.com.

          donford 1 Reply Last reply Reply Quote 0
          • donford
            donford @Mobilio last edited by

            Hi Peter,

            That is true, it appears however the question is if it is okay to use relative paths.

            In which Google says:

            "...Avoid errors: use absolute paths rather than relative paths with the rel="canonical" link element.

            Use this structure:  https://www.example.com/dresses/green/greendresss.html
            Not this structure: /dresses/green/greendress.html).."

            REF: https://support.google.com/webmasters/answer/139066?hl=en

            I always side on the better to be safe side of things.

            Cheers,

            Don

            Mobilio 1 Reply Last reply Reply Quote 2
            • Mobilio
              Mobilio @donford last edited by

              I agree,

              you should avoid them at all.

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              • Will this URL structure: "domain.com/s/content-title" cause problems?
                0
                2
                42

              • How can I change the page title "two" (artigos/page/2.html) in each category ?
                sprynewmedia
                sprynewmedia
                0
                3
                118

              • Ideally should a 301 or 302 redirect be used from https://www.site.com to http://www.site.com? Is there a valid reason to use a 302 in this situation or would using a 301 have any negative impact on seo?
                Unity
                Unity
                0
                2
                317

              • "Standout" tag and "Original content" tags - what's the latest?
                BrianCrouch
                BrianCrouch
                0
                2
                423

              • I have a site that has both http:// and https:// versions indexed, e.g. https://www.homepage.com/ and http://www.homepage.com/. How do I de-index the https// versions without losing the link juice that is going to the https://homepage.com/ pages?
                fthead9
                fthead9
                0
                3
                729

              • Can I use canonical tags to merge property map pages and availability pages to their counterpart overview pages?
                AlanBleiweiss
                AlanBleiweiss
                0
                5
                784

              • Should I use a "-", ":", or "|" in the title tag?
                CPU
                CPU
                0
                3
                826

              • New website branding, differences between http://www and http://
                PathInteractive
                PathInteractive
                1
                10
                1.3k

              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