I had problems with the routing after deploying my react app on netlify. I inserted a _redirects file to my public folder with this code /* /index.html 200
as recommended.
Yet, when I refresh the page from an advanced route e.g. '/sceneries/beach', it always pushes me back to the index page. Locally it has been working perfectly before. Do you know how to solve this? My routes currently look like this:
in index.js
ReactDOM.render((
<Router history={history}>
<App />
</Router>
), document.getElementById('root'));
in App.js
<BrowserRouter>
<Route path='/' component ={Home} />
<Route path='/sceneries/:id' component ={Comparison} />
<Redirect from="*" to="/" />
</BrowserRouter>
Thanks a lot in advance! I really appreciate some help!