voorhoede / head-start

Base setup on top of headless services to help you quickly start a new website
ISC License
3 stars 0 forks source link

404 page not working #135

Open luukbrauckmann opened 3 months ago

luukbrauckmann commented 3 months ago

The 404 page is not working. If you move the files to /src/pages instead of /src/pages/[locale] it will work, but you lose the locale parameter so there may be a other way to solve this.

decrek commented 3 months ago

Is this in production or in development? There is a "creative way" of enabling localised 404 pages, that is run postbuild only on production builds. See https://github.com/voorhoede/head-start/blob/main/scripts/move-404-pages.ts

luukbrauckmann commented 3 months ago

The 404s do work in production. The problem is only in development. I researched if there were other ways to redirect the 404s like you can do with Netlify for example, but Cloudflare doesn't provide that possibility at the moment.

jbmoelker commented 1 month ago

I wouldn't label this as a bug, but rather a request for improvement of the local development experience.

@decrek do you think we can tweak the current way the 404 dist pages are created, and add a 404 or in the src root that reuses the localised 404 page, like we did temporarily in this workaround? https://github.com/voorhoede/head-start/blob/3b21847c6ffc17412e2414c16374451e641601e9/src/pages/%5Blocale%5D/%5B...path%5D/index.astro#L5

I do think that could lead to less confusion. Otherwise I would label this one as wontfix and close it.