DEV Community

Igwe Chinonso
Igwe Chinonso

Posted on

Fix Page not found error when visiting a route directly in react

Have you ever gotten the dreaded "sorry page not found" error when visiting a particular route by entering its url directly in your browser tab after pushing your react app to production(netlify for instance)?.

There is a quick fix you can use to resolve the issue.

create a file called _redirects in your public folder and add this line of code

/* /index.html 200.

This should fix your error.

Thanks for reading.

Top comments (0)