Building a totally static website using Astro 4.15.4. And by totally static, I mean I'm using Astro to generate my .htaccess file. My server will have absolutely no custom code on it.
I'd like the 404 page to work like every other page on the site using the default of 'directory' for config's build.format. Thus, I expect my 404 page to be output at "/404/index.html".
As of now, I cannot find any way to do this. Instead, it always renders as "/404.html" or outputs something weirder still. It seems as though Astro is hard-wired to do this: https://docs.astro.build/en/basics/astro-pages/#custom-404-error-page
These are the failing methods I have tried so far:
- pages/404.astro - outputs "404.html"
- pages/404.mdx - outputs "404.html"
- pages/404/index.astro - outputs "404.html"
- pages/[404].astro and set getStaticPaths to output "404" - outputs "/404.html".
- pages/[...404].astro and set getStaticPaths to output "404" - outputs "/404.html".
- pages/[...404].astro and set getStaticPaths to output "404/index.html" - outputs "/404/index.html/index.html".
- content/pages/404.mdx and then use a collection renderer for "pages" (via [...pages].astro) which renders most of the rest of my pages, getStaticPaths set to "404" - outputs "/404.html"
I'm at a loss. It seems that if anything even vaguely looks like /404/ in the output, it gets turned into 404.html.