Use a _redirect
file at the root of your Astro project (SSR/SSG)
Note: If your using the SSR adapter (
@astrojs/netlify
) with Astro's Custom 404 Error Pages this may not work due to the way the adapter works
- Install plugin:
npm i netlify-plugin-append-redirects
- Add plugin to
netlify.toml
:
[[plugins]]
package = "netlify-plugin-append-redirects"
-
Create a
_redirect
file at the root of your project: -
Deploy to Netlify