How to redirect non existent files

I have a react spa pwa created with CRA.
Because its client side routing , I added a redirect * to / in netify.toml.

But sometimes if user accidently or on purpose or due to some other reasons deletes some js precache entries from browser. The js files being returned from server is index.html (because of above redirect).

I wont to redirect non-existiing js files to a dummy js file , so that spa don’t crash

You can redirect based on status:

[[redirects]]
from = "/*"
to = "/page-to-redirect-to"
status = 404
1 Like