3

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?

1 Answer 1

1

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

3
  • I've just encountered the same problem. I added the .nojekyll file, but Google search console still fails to fetch it. Did it work for you?
    – gourabix
    May 26, 2021 at 21:50
  • @gourabix Yes, it did work for me... Could you please show me your repository? Maybe I could help!
    – Looky1173
    May 27, 2021 at 5:22
  • 1
    This answer worked for my GitHub pages repository.
    – Barzee
    Apr 30, 2022 at 20:15

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.