Why isn't Cloudflare Pages / Hosting throwing 404s?
Hey, for example, one of my websites, I can go to any URL and in the browsers network tab it always throws a 200 instead of a 404.
Here is an example: https://zarrasvand.com/This.Does.Not.Exist
Zarrasvand | Business transformation with Generative AI
Zarrasvand.com | Business transformation with Generative AI
4 Replies
If you don't have a 404.html top-level, it will default to SPA (Single Page Application Behavior) and serve index.html with 200
https://developers.cloudflare.com/pages/configuration/serving-pages/#single-page-application-spa-rendering
Thank you! So, all I need is a top level 404.html?
yes, and it will serve that instead on a page not found with the status code of 404
Thank you!
Workes like a charm, solved 🙂