-
-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide custom 404 static pages #412
Comments
This can be done by prerendering an API route, similar to rendering an XML feed https://analogjs.org/docs/features/api/overview#defining-xml-content |
@brandonroberts
my
and the file structure is like
content of
|
@anuj9196 its supposed to be |
@brandonroberts |
@anuj9196 you can add a postRenderingHook to your vite config to change the output file names like this: postRenderingHooks: [
// eslint-disable-next-line @typescript-eslint/require-await
async (route: PrerenderRoute): Promise<void> => {
const parts = route.fileName?.split("/");
if (parts != null && parts.length > 2) {
parts.pop();
route.fileName = `${parts.join("/")}.html`;
}
},
], This will rename all files from |
@DerHerrGammler Nitro also has a setting for this nitro: {
prerender: {
autoSubfolderIndex: false
}
} |
Which scope/s are relevant/related to the feature request?
Don't known / other
Information
It would be useful to be able to pre-render custom
404.html
pages from Angular pages, similar to: https://docs.astro.build/en/core-concepts/astro-pages/#custom-404-error-pageIdeally, multiple custom
404.html
pages could be created, one per route. This would help deploying static sites to Cloudflare PagesDescribe any alternatives/workarounds you're currently using
No response
I would be willing to submit a PR to fix this issue
The text was updated successfully, but these errors were encountered: