It's because there's a service worker which installs into the browser. Service workers even work when you visit a page offline, which is why it started working when the page 404'd, it kicks into action and fetches the content.
You should not configure your webserver to only give 200 responses, it can lead to google deranking you for manipulation and bots absolutely hammering your webserver with traffic because you respond to 200 on all their requests searching for exploits.
Good point, I guess I'd still redirect to /index.html so that it could load reactJS, but would respond appropriately with 404 from index.js if it's requesting non existing route.
It's because there's a service worker which installs into the browser. Service workers even work when you visit a page offline, which is why it started working when the page 404'd, it kicks into action and fetches the content.
You should not configure your webserver to only give 200 responses, it can lead to google deranking you for manipulation and bots absolutely hammering your webserver with traffic because you respond to 200 on all their requests searching for exploits.
Good point, I guess I'd still redirect to /index.html so that it could load reactJS, but would respond appropriately with 404 from index.js if it's requesting non existing route.
Yep pretty much. VueJS has a good doc on this - router.vuejs.org/guide/essentials/...
@gtb3nw can you provide any evidence that Google may penalize for 200 responses. I tried to google and can't find any references to this rule.