Sitemap Redirect me to homepage and Your Sitemap appears to be an HTML page

#197738
  • Resolved Marios
    Rank Math pro
    Content AI Starter

    hi,

    when i try to open sitemap link i redirected to my homepage, and i realized that because i got the following error to google search console

    “Your Sitemap appears to be an HTML page. Please use a supported sitemap format instead”

    also on the https://www.xml-sitemaps.com/validate-xml-sitemap.html i got ERROR, it does not recognized the sitemap.

    I saw some othere relevant tickets for those kind of errors here and i followed all the instructions that i saw:

    i flushed the Sitemap cache by following this video screencast: https://i.rankmath.com/xXXhDt

    i have excluded from cache enabler the sitemap with the following regex for pages /(^\/sitemaps.xml)/

    I cleared and disabled the cache from server site (nginx cache). Is there anythinig else that i have to do? Still cant open sitemap url, still got the google search error.

    regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for the delay and for any inconvenience this issue may have caused you.

    I’ve checked your sitemap, and indeed it is redirecting to your homepage. However, when I tried accessing /?sitemap=1, your sitemap shows fine. In this case, you may need to add this rule to your Nginx config file:

    # START Nginx Rewrites for Rank Math Sitemaps
    rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last;
    rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
    # END Nginx Rewrites for Rank Math Sitemaps

    Here’s a link for your reference:
    https://rankmath.com/kb/fix-sitemap-issues/#6-my-sitemap-is-not-working-on-my-nginx-web-server

    Once done, please clear your website and sitemap cache. Then resubmit your main sitemap only /sitemap_index.xml in your Google Search Console account and give Google some time to recrawl your site.

    I hope that helps.

    Thank you, and looking forward to your update.

    Marios
    Rank Math pro
    Content AI Starter

    hi,

    Ok i set that code you said, now i am able to open my site map with the domain.com/sitemap_index.xml way. So i will wait for google about 4 days as usuall to recrawl my website to see if it fixed. Thanks for the fast help.

    regards

    Hello,

    Thank you for the update.

    We’re glad that your sitemap is already fixed.

    Sure, let us know how this goes. We are always here to help.

    Meanwhile, please don’t hesitate to contact us anytime to assist you further with anything else.

    Looking forward to helping you.

    Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)

The ticket ‘Sitemap Redirect me to homepage and Your Sitemap appears to be an HTML page’ is closed to new replies.