Github pages: how to redirect error url to 404.html page with nojekyll

I have created simple static site on github pages.
The page https://docs.github.com/en/pages/getting-started-with-github-pages/creating-a-custom-404-page-for-your-github-pages-site says that all error url-s should be redirected to 404.html page.
But the problem is that there is a .nojekyll file in my root folder. So, error url-s just shows “Error code: 404” and www.example.com/404 shows my custom 404.html.
Is there a way to fix this issue?

about .nojekyll: I get hosting on github pages with 1st goal – to place there a google assets file with key by special url with the dot at the beginning of the folder name. This file should be accessible by robots without any redirection with the plain access. But without .nojekyll file a folder with the dot at the beginning is not visible ..

Leave a Comment