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
Chaika
Chaika•3mo ago
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
Sia
Sia•3mo ago
Thank you! So, all I need is a top level 404.html?
Chaika
Chaika•3mo ago
yes, and it will serve that instead on a page not found with the status code of 404
Sia
Sia•3mo ago
Thank you! Workes like a charm, solved 🙂
Want results from more Discord servers?
Add your server
More Posts