Google error: Your Sitemap appears to be an HTML page

Created on 6 December 2024, 16 days ago

Hi All,

I have stripped down sitemap.xml to include only root url and google still complains that it's html.
Anyone encountered such issue before?

Thanks,

🐛 Bug report
Status

Active

Version

4.2

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @monkk
  • @monkk I am able to validate sitemap.xml on google search console with sitemap checker

  • @monkk I am able to validate sitemap.xml on google search console with sitemap checker

  • 🇩🇪Germany gbyte Berlin

    First of all, please always test on the dev version before submitting bug reports. Secondly, its more courteous to submit tickets as support requests if you are unsure of it being a bug. Can you give me the link to the sitemap? If you prefer, you can do it through the Drupal email functionality

  • Apologies, indeed support request was intend.
    I checked with some online checker and seems content-type header is set to text/html; charset=utf-8.
    I guess happy debuging?

  • 🇩🇪Germany gbyte Berlin

    Can you give me the link to the sitemap? If you prefer, you can do it through the Drupal email functionality

    Feel free to send me that link.

    I checked with some online checker and seems content-type header is set to text/html; charset=utf-8. I guess, happy debugging session for me.

    It should definitely be application/xml

    Do I understand correctly that sitemap.xml is not always generated on the fly? Ie, there is no more actual file sitemap.xml laying on server?

    It's stored in your database and fetched when the sitemap route is being visited. There is no actual file but it is not generated on the fly.

  • 🇩🇪Germany gbyte Berlin

    Something seems wrong with your site. When I open your site in a new browser, I get redirected to the front page (hence google says it's html instead of xml). On the second try I get the sitmemap. That seems to be the problem; try to disable any modules that may redirect the user on the first visit. Maybe something is redirecting to front page then setting a cookie like a language module or something? Good luck!

    Feel free to reopen this issue if you need further help.

  • Indeed seems there was some pesky redirect from one of the modules. Thank you for your help!

Production build 0.71.5 2024