H
H
Hazrat Hajikerimov2017-05-26 14:59:53
React
Hazrat Hajikerimov, 2017-05-26 14:59:53

Issue with react-router, "Not Found" on page refresh?

The strange behavior of react-router-dom v4, in general, with webpack-dev-server's property historyApiFallback: truewhen updating the page on some module, correctly updates the page and displays the desired module.
But when creating a bundle for production, a problem arises, react-router displays the following message if you update the page on some module, for example /contact:
Not Found
But if you update on the main one, then everything works fine.
What is it connected with? I looked in the documentation for react-router-dom, there is a property there forceRefresh, by setting it to true it only reloads the page and doesn't solve the problem.
The configuration can be viewed at the link: webpack-app

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
Hazrat Hajikerimov, 2017-05-27
@hazratgs

Everything is much simpler, you need to enable mod_rewrite ))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question