Search code examples
reactjslaravelrefreshreact-laravel

Refresh page React-Laravel


I have a problem with my front-end in Reactjs(my back-end is in Laravel). When I reload a pages, I have this error "Sorry, the page you are looking for could not be found." I don't know why and how resolve this. It's in my Router ?

Thanks for your help


Solution

  • You should have a configuration file respective to laravel for redirecting all the routes to index.html file. The issue is that since you have react router which is an application's internal route, server thinks it as an external application path. So you should have a router forwarding configuration to serve index.html irrespective of the route. In IIS it is done using web.config file.