What it means
In a single-page app, a router such as React Router changes the address without asking the server. If you open /dashboard directly, or refresh on it, the browser asks the server for a file called dashboard. There is none. The server has to return index.html and let your app take over.
What Antideploy does
The server that hosts a static site or a built single-page app returns index.html for any address that has no file extension. A route such as /dashboard loads your app, and its router takes over. A missing file with an extension, such as a missing logo.png, returns a real 404. If your project has a 404.html, that page is shown for those.
If you still get a 404
-
The route has a dot in it. A path such as
/reports/v1.2looks like a file because of the.2. Avoid dots in route paths. -
Your project is an app with its own server. Then your server decides. Make it return
index.htmlfor routes it does not know. -
You use a Dockerfile with a web server. If your Dockerfile runs a web server such as nginx, its configuration decides. Add a rule that falls back to
index.html. -
A wrong base path. If your app is built to live under a folder, assets and links break. Set the base path to
/, for examplebase: "/"in a Vite config.