If you don't want to use HashRouter AND (importantly) you don't have dynamic routes (e.g. example.com/user/{userId}
) then you can manually add a copy of index.html for each route route.
For example, if you have /pricing
and /login
routes, you can make a copies of index.html
, one named pricing.html
and the other named login.html
. The browser should look for the correct file when going to /pricing
etc.
You can still use dynamic routing, but you have to use query params like youtube e.g. youtube.com/?v=VIDEO_ID