Search code examples
xmlgithub-pagessitemapgoogle-search-console

Sitemap (XML) partially works on GitHub Pages and cannot be fetched by Google Search Console


I have a site with a custom domain hosted on GitHub Pages. I've added a sitemap file to my repository with the name sitemap.xml. I am able to access it by going to https://example.com/sitemap; however, https://example.com/sitemap.xml returns a 404 error.

Furthermore, when I try to add the aforementioned sitemap to Google Search Console, it cannot fetch it. I've tried both URLs and neither works.

I am not using Jekyll or any other framework. What can I do?


Solution

  • Adding a .nojekyll file to my repository solved the problem. I guess GitHub Pages assumed I was using Jekyll and incorrectly compiled my website.