I'm trying to submit my sitemap on my Google console but every time I add it, it keeps saying it couldn't fetch, I have uploaded my sitemap.xml into my domain root directory but still Google is not seeing it. Please, how can I solve this issue, have been on this for the past two days and it's like I'm going in circles.

My sitemap is in the public_html folder with name sitemap.xml.

UPDATE#1: This is my directory structure:


UPDATE#2: This my .htaccess file in the document root:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^$ public/ [L]
    RewriteRule (.*) public/$1 [L]
  • 2
    Requesting /sitemap.xml from your site does result in a 404 - so you do seem to have an issue with your site? (But when you submit a sitemap to GSC, you physically upload it to Google - it doesn't need to "fetch" it?) – MrWhite Dec 29 '18 at 13:21
  • Thank you for your response, much appreciated but at the moment I don't know how to fix this error, I have read all through blogs they don't seems to provide solution for easy for me fix.. I'm very sure I did everything right uploading my sitemap but I don't know whatelse to fix on my GSC to get it successful. Please see my attached image here for possible solution suggest imgur.com/a/OSlqpuw – kratosserver2008 Dec 30 '18 at 11:11
  • 1
    The problem is with your site, not GSC. How did you upload this file to your site? What web server are you using? – MrWhite Dec 30 '18 at 14:49
  • Thank you, I upload files to my web server through cpanel and here is information about my server in the attached image here imgur.com/a/8nmVSjH – kratosserver2008 Dec 30 '18 at 20:21
  • Where is your robots.txt file located? Are you rewriting URLs to a subdirectory perhaps? (Maybe include the contents of your .htaccess file in your question.) – MrWhite Dec 31 '18 at 0:05

Having looked at your directory structure, it would seem that many (all?) files in the document root (where you have uploaded sitemap.xml) are not accessible - they all return 404 Not Found when accessed publicly.

It looks like this might be a Laravel app and you are perhaps rewriting everything to the /public subdirectory (a typical usage pattern with Laravel). In which case you should move sitemap.xml (and any other files that should be publicly accessible) to the /public subdirectory.

To confirm this, we would need to see the contents of your root .htaccess file. (Please edit your question to include this.)

UPDATE: Your .htaccess file confirms the above.

RewriteRule ^$ public/ [L]
RewriteRule (.*) public/$1 [L]

From your .htaccess file in the document root we can see that all requests are rewritten to the /public subdirectory. So, a request for example.com/sitemap.xml is internally rewritten to example.com/public/sitemap.xml.

This means your document root is "effectively" /home/winnerrs/public_html/public, not /home/winnerrs/public_html, as you first thought.

You need to move the sitemap.xml file from the public_html directory to the public_html/public directory.

  • Thank you so much for your time, you're so correct it's a Laravel app, I'm not much of a techie, I'm just a user that manage few backend files.. But here is a look at the .htaccess files as requested here imgur.com/a/RQ69CRL.. Please work me through what I should probably do to fix this. Once again thank you so much – kratosserver2008 Dec 31 '18 at 13:36
  • Yes, your .htaccess file confirms my assumption. You need to move the sitemap.xml file from the public_html directory to the public_html/public directory. I've updated my answer. – MrWhite Dec 31 '18 at 20:57
  • 1
    Thank you for your time, I so much appreciate that I found the help and you took your precious time to help out. I resubmitted and it was successful. Thank you thank you thank. – kratosserver2008 Dec 31 '18 at 21:52

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.