Need a guide for server configuration of index.html Fallback #8413
Unanswered
andreawyss
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It is still very hard to find online complete and correct examples on how to configure various servers for History pushState.
When using ReactRouter (History pushState API) it should be simple to find and understand how to correctly configure any popular server:
Given that a SPA can be just a portion on the full served website these are the requirements:
/my-base/index.html
is where the actual index exists for a spa/my-base/route/sub-route
must fallback toindex.html
located in '/my-base'/my-base/route/abc.js
must not fallback because name has a period/some-base/route/sub-route
must not fallback because it is not undermy-base
/other-spa/index.html
is where the actual index exists for another spa/other-spa/route/sub-route
must fallback toindex.html
located in '/other-spa'/other-spa/route/abc.js
must not fallback because name has a period/some-base/route/sub-route
must not fallback because it is not underother-spa
It is clear that this is not
react-router
problem but it still greatly impacts the developer experience of using the library when one cannot find how to setup the server correctly.A simple page in the guides with links to relevant servers configuration on how to correctly achieve this would be really helpful.
The lack of this information forces many projects to use
HashRouter
just because no one on the team could getBrowserRouter
to work in the dev and prod environments.Beta Was this translation helpful? Give feedback.
All reactions