3

Today I moved my site from HTTP to HTTPs successfully.

Code I used:

if($_SERVER["HTTPS"] != "on"){
    if(php_sapi_name() === 'cli'){
    }
    else{
            $host = $_SERVER['HTTP_HOST'];
            $request_uri = $_SERVER['REQUEST_URI'];
            $new_url = "https://" . $host . $request_uri;
            header( "HTTP/1.1 301 Moved Permanently" );
            header( "Location: $new_url" );
            exit;
    }
}

Issue that I'm facing:

When I try to submit my sitemap (https://example.com/support/ssl_siteMap_worksheet.xml):

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
    <loc>https://example.com/worksheet/rebus/maths/</loc>
    <lastmod>2014-10-24</lastmod>
    <changefreq>weekly</changefreq>
    <priority>0.5</priority>
</url>
<url>
    <loc>https://example.com/worksheet/rebus/kids/</loc>
    <lastmod>2014-10-24</lastmod>
    <changefreq>weekly</changefreq>
    <priority>0.5</priority>
</url>
<url>
    <loc>https://example.com/worksheet/rebus/medium/</loc>
    <lastmod>2014-10-24</lastmod>
    <changefreq>weekly</changefreq>
    <priority>0.5</priority>
</url>
<url>
    <loc>https://example.com/worksheet/rebus/hard/</loc>
    <lastmod>2014-10-24</lastmod>
    <changefreq>weekly</changefreq>
    <priority>0.5</priority>
</url>
<url>
    <loc>https://example.com/worksheet/rebus/</loc>
    <lastmod>2014-10-24</lastmod>
    <changefreq>weekly</changefreq>
    <priority>0.5</priority>
</url>
</urlset>

It's giving me the following error:

Warnings, URL blocked by robots.txt, Sitemap contains URLs which are blocked by robots.txt.

Here is my robots.txt file:

User-agent:    *
Disallow:   /smarty/*
Disallow:   /images/*
Disallow:   /images/
Disallow:   /css/*
Disallow:   /css/
Disallow:   /minify/
Disallow:   /minify/*
Disallow:   default.php

#Begin Attracta SEO Tools Sitemap. Do not remove
sitemap: http://example.com/support/siteMap_interview_allpuzzles.xml
sitemap: http://example.com/support/siteMap_interview_compuzzles.xml
sitemap: http://example.com/support/siteMap_interview_list.xml
sitemap: http://example.com/support/siteMap_interview_process.xml
sitemap: http://example.com/support/siteMap_interview_tech.xml
sitemap: http://example.com/support/siteMap_list_puzzles_riddles.xml
sitemap: http://example.com/support/siteMap_main_1.xml
sitemap: http://example.com/support/siteMap_main_2.xml
sitemap: https://example.com/support/ssl_siteMap_worksheet.xml
#End Attracta SEO Tools Sitemap. Do not remove

Note: If I change URLs in sitemap from HTTPS to HTTP, it's working. i.e If the change from

https://example.com/worksheet/rebus/maths/

to

http://example.com/worksheet/rebus/maths/

Sitemap submission is not showing an error.

  • Are you submitting the sitemap to the HTTPS property in GSC? – MrWhite Apr 23 '17 at 21:59
  • Can you show us both version(http and https) of your robots.txt? I don't know why you're mixing(http and https) sitemap into robots.txt, just keep it simple. – Goyllo Apr 24 '17 at 16:00
2

I face the similar issue and you it was resolved when I contact the service provider i.e HostGator/Bluehost (not sure which one) and after a day it got resolved.

  • Can you say how they resolved it? – John Conde Apr 24 '17 at 15:37
  • @JohnConde they were blocking at nginx level – chicharito Apr 24 '17 at 17:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.