How to add 404 page in Astro

June 15, 2021

You can add a 404 not found page for your Astro website just by creating a normal Astro page at src/pages/404.astro.

Most static hosting services (Netlify, Vercel, etc) will pick this page up as a 404 page, and show it when there's no matching page at a given URL.

A quick favor: was anything I wrote incorrect or misspelled, or do you still have questions? Please use this form to let me know or ask for help!