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. Online Marketing Tools
    4. Creating A Sitemap.xml file for an https site query.

    Creating A Sitemap.xml file for an https site query.

    Online Marketing Tools
    6 5 7.3k
    • 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.
    • DavidZA1
      DavidZA1 last edited by

      Hi Guys

      I would like to know what is best practices when creating a sitemal.xml file for an https site.

      Should I create one with http urls in it or one with https urls in it.

      My website does redirect from http to https.

      Also in the robots.txt file should i reference my sitemap file location with http or https?

      For example: sitemap: http://www.example.co.za/sitemap.xml / sitemap: https://www.example.co.za/sitemap.xml ?

      This is for a newly created site that still needs to be launched.

      **If anybody could please get back to me on this I would appreciate it.

      Thanks

      Dave**

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

        The important things are-

        1. Be smart about the site structure:  to keep the engines from crawling and indexing HTTPS pages, structure the website so that HTTPs are only accessible through a form submission (log-in, sign-up, or payment pages). The common mistake is making these pages available via a standard link (happens when you are either ignorant or  not aware that the secure version of the site is being crawled and indexed).
        2. Use Robots.txt file to control which pages will be crawled and indexed
        3. Use.htaccess file. Here’s how to do this:
        4. Create a file names robots_ssl.txt in your root.
        5. Add the following code to your .htaccessRewriteCond %{SERVER_PORT} 443 [NC]RewriteRule ^robots.txt$ robots_ssl.txt [L]
        6. Remove yourdomain.com:443 from the webmaster tools if the pages have already been crawled
        7. For dynamic pages like php, try< ?phpif ($_SERVER["SERVER_PORT"] == 443){echo “< meta name=” robots ” content=” noindex,nofollow ” > “;}?>
        8. Dramatic solution (may not always be possible): 301 redirect the HTTPS pages to the HTTP pages – with hopes that the link juice will transfer over.

        For more information please refer to this link :

        http://www.seomoz.org/ugc/solving...

        This answer is not my own but Harald Tschuggnall - http://www.seomoz.org/users/profile/370267

        Read it and found it appropriate for your query.

        Hope this helps.

        1 Reply Last reply Reply Quote -3
        • MoosaHemani
          MoosaHemani last edited by

          Dave i am not sure why you are using the encrypted version of URLs that is https instead of http but if you using it there is no need to add http version in the sitemap... only add https URLs and submit the xml sitemap to Google website tools.

          Personally I don’t see any need of adding xml sitemap’s URL in a robots.txt file as you are including xml sitemap to Google webmaster tool anyways...

          G.Anderson 1 Reply Last reply Reply Quote 2
          • DavidZA1
            DavidZA1 last edited by

            Thanks for the reply Moosa.

            1 Reply Last reply Reply Quote 0
            • G.Anderson
              G.Anderson @MoosaHemani last edited by

              Moosa,

              I know this question was responded to last year but I am having a similar issue:

              We have our homepage under SSL but other pages on the site are in regular http. When we submit the sitemap, should we include the https version of the homepage and then the regular http versions of the other pages?

              Again, the whole site is NOT under SSL, so we just want to be sure there is consistency in the sitemap for googlebot to easily access all pages.

              Thanks for any input.

              -G

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

                I have the same issue as Moosa. I have a site where some pages (in Spanish) are https. The english pages are http. Can you tell me if it's okay to have both in the sitemap.xml?

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post
                • I am trying to edit the site crawl issues on my site, but my wp editing bar is not showing up on one of my campaigns when I click on the page that has errors. Help, please.
                  effectdigital
                  effectdigital
                  0
                  2
                  48

                • Best xml sitemap generator that includes images, video, and text
                  lfrazer
                  lfrazer
                  0
                  4
                  2.5k

                • Sitemap.xml service or software
                  Hutch42
                  Hutch42
                  1
                  3
                  262

                • My Site Auditor
                  Ram.Babu
                  Ram.Babu
                  0
                  2
                  1.5k

                • Validating sitemap crawl on Google and Bing WMTs for an externally hosted sitemap.
                  Christy-Correll
                  Christy-Correll
                  0
                  4
                  479

                • What sites do you use to test design changes, etc. (sites like fivesecondtest.com)
                  JakubMovic
                  JakubMovic
                  0
                  3
                  436

                • Is there a tool or service that will post product reviews from an aggregator site onto our site's product pages?
                  danatanseo
                  danatanseo
                  0
                  3
                  2.9k

                • Creating a visual sitemap - any software out there?
                  Andy.Drinkwater
                  Andy.Drinkwater
                  0
                  5
                  5.8k

                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