-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Custom 404 with Astro SSR not working on Netlify #4269
Comments
Thank you for openning this issue. Has been driving me crazy for the past 2 days. We talked about it on the discord channel and I have come with the next temporary solution using We need to add the next redirect:
That way the 404 responses will be redirected and handled by the function like it does with the rest of pages. |
I retract from my previous message. It does work. The displayed error is non-related about a react component used within the 404 page. For that I am sorry With the redirect as stated above it works perfectly on production! |
Thanks for the info @irg1008! Going to add that to our integration. |
@irg1008 does that entry need to be the last one in the redirects file? |
Do we have the same functionality for vercel.com also ? |
I don't see a _redirect file in static folder. It is only in dict folder and the last two line are these |
Unfortunately this solution is not working for my site. |
What version of
astro
are you using?1.0.2
Are you using an SSR adapter? If so, which one?
Netlify
What package manager are you using?
npm
What operating system are you using?
MacOS
Describe the Bug
When a user applies the
netlify
adapter (and turns the output to 'server') to produce a SSR build, it appears as though a custom 404 page doesn't get picked up for the redirect rules anymore. Even if a user also tries to use thenetlify.toml
to manually conduct the 404 redirect, it doesn't pick up the custom page.It was a user reported bug within the Discord.
You can see this live in these two experiences:
Link to Minimal Reproducible Example
maxcell/test-astro-ssr#1
Participation
The text was updated successfully, but these errors were encountered: