#7642·pocketbase

[Feature] Allow specifying the fallback page

Author: matthewCmattCreated Apr 13, 2026Updated Apr 13, 2026

Allow the Static handler function to specify a fallback page which is different than the root index.

Currently, you can configure the Static file server to provide a fallback html page whenever a user would otherwise get a 404. This is limited to only serving the root /index.html as the fallback.

Instead, this feature would let you specify a different route for the fallback page (e.g. /200.html). This avoids having your fallback page be the home page.

In my use-case, I'm serving a static SvelteKit app with some pages being pre-rendered, but this conflicts at the home page (/index.html). I'd like to prerender my home page (in fact it feels like the MOST important page to prerender), but SvelteKit does not allow prerendering the page you configure as fallback. They also recommend against using /index.html as the fallback in their docs: "You should avoid index.html where possible to avoid conflicting with a prerendered homepage."

My current workaround will be to re-implement the static file handler, which is a fine solution, just feels like a lot for just this functionality.