antfu / vitesse

🏕 Opinionated Vite + Vue Starter Template

Home Page:https://vitesse.netlify.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Catch all route doesn't return 404 status code

Rigo-m opened this issue · comments

https://vitesse.netlify.app/asdfasf -> document returns 200, not 404

It's a server side configuration

example of config for netlify :

[[redirects]]
  from = "/*"
  to = "/404.html"
  status = 404

result : (using httpie)

$ https flapili.fr --print=h
HTTP/1.1 200 OK
[...]

$ https flapili.fr/abc --print=h
HTTP/1.1 404 Not Found
[...]

you should also add navigationFallback entry on workbox to 404.html in VitePWA plugin configuration

This is how SPA works. If you really want that, you might want to go with Nuxt instead.