Server side setup for History API method
When you use the History API and point the browser to the root path / (usually /index.html) all links and Routes will work properly. But when you start your app on any subpage, like /page/subpage, you will see the 404 Not found error. Because of this, you need to setup your server to point all requests to /index.html.
This is easy if you use the official Svelte template. Just open package.json and find this NPM script:
"start": "sirv public"
Replace it with this line:
"start": "sirv public --single"
Now, start your app with npm run dev and open a URL like http://localhost:5000/page/subpage. You should see the app page, instead of the "Not found" error.
For other servers you can read the following links: Nginx, Apache, Caddy
I have read the docs:
"start": "sirv public"
"start": "sirv public --single"
But how should I solve it with Vite?