From the Redirect options documentation:
You can set up a custom 404 page for all paths that don’t resolve to a static file. This doesn’t require any redirect rules. If you add a
404.htmlpage to your site, it will be picked up and displayed automatically for any failed paths.
This seems to work just fine for pages that don’t exist and for most special files, but fetching /404 or /404.html returns HTTP 200 instead of HTTP 404. As far as I’m aware, this is bad practice, and it may cause Google Search to be confused as to whether it should index such a soft 404 error page or not.
I did figure out a workaround by adding the following lines in my
_redirects file, but it’s a bit silly:
/404.html /404 404! /404 /404.html 404!
Note that self-redirects are ignored for some reason, hence why I had to write the rules like that.
A proper fix would be appreciated.