Cloudflare Pages Single-page application (SPA) rendering how to return a 404 for non router pages?
The Pages docs for spa rendinerg say that if there is no 404.html it will default to /index.html which will be handled by my SPA (vue router app) this is great.
I have a catch alli in my vue router that displays a 404 vue page if there is not route present, however cloudfalre will return a 200 OK MESSAGE for these, as it doesn't know the page actually doesnt exisit. Hence crawlers too think this page exists.. How can i force cloudflare to return a 404 page for pages that are not in my vue router?
1 Reply
I am sure _redirects file can solve this, but the issue is how can i have my soft 404 client side route to this and return a 404
if making a 404.html also doesnt work becuase it breaks the SPA app, as the docs say.