I\'m using React-router and it works fine while I\'m clicking on link buttons, but when I refresh my webpage it does not load what I want.
For instance, I am in
This topic is a little bit old and solved but I would like to suggest you a simply, clear and better solution. It works if you use web server.
Each web server has an ability to redirect the user to an error page in case of http 404. To solve this issue you need to redirect user to the index page.
If you use Java base server (tomcat or any java application server) the solution could be the following:
web.xml:
index.jsp
404
/index.jsp
Example:
That is it, no more magic needs:)