How to fix url server refresh

(Saša Fišter) #1

Obvious, that’s nothing new. I have app that use reacjs for navigating through different pages. So I want to be able to return user back to ‘reactjs route’ after they hit refresh. Basically, if user is on /about page and hits refresh, I want to ping react to trigger that route.

I’m using react-router 4.

(Mikayel) #2

If I understand correctly you need something like this ?

I have similar code for react-router4 here
You need to config your web server. See .htaccess . In this case I am using Apache. You just need to tell your web server to open index.html for all routs.