DEV Community

Discussion on: React Router not Working in Production

Collapse
 
mackr2015 profile image
mackelele

I have the same exact problem.

Only showing up in the production as local dev as this is done behind the scene.
Following some suggestions on the web I did a temporary fix by re-directing Apache ErrorDocument to point to index.html.

This is a temporary fix and it still gets 404 in the console. I am yet to find a solution.

Inside of your server apache/nginx configuration /etc/apache2/sites-available/ ( find correct conf for nginx edit the virtualhost with the following.

ErrorDocument 404 /index.html

Hope this help someone.