kit icon indicating copy to clipboard operation
kit copied to clipboard

Improve the docs on 404 pages for unknown routes

Open PeppeL-G opened this issue 1 year ago • 0 comments

Describe the problem

When looking up information on how 404s work for unknown routes, I ended up reading the docs about +error.svelte. There it says:

If no route can be found (404), src/routes/+error.svelte (or the default error page, if that file does not exist) will be used.

This made me believe you couldn't have different 404 pages for different unknown routes, so I stopped looking for more information.

But later I (by accident) stumbled upon the docs about 404 pages, where they explain how you can "turn unknown routes into known routes using rest parameters", so it is indeed possible to have different 404 pages for "unknown routes", but I read the docs as it wasn't possible, and therefore I stopped looking for such a solution, and missed it.

Describe the proposed solution

I propose the docs about +error.svelte also contains a link to the docs about 404 pages. The following part:

If no route can be found (404), src/routes/+error.svelte (or the default error page, if that file does not exist) will be used.

Could for example be:

If no route can be found (404), src/routes/+error.svelte (or the default error page, if that file does not exist) will be used. If you need to use different error pages for different unknown routes, see 404 pages.

Alternatives considered

No response

Importance

nice to have

Additional Information

No response

PeppeL-G avatar Aug 11 '24 08:08 PeppeL-G