# Problem when navigating routing

**URL:** <https://answers.netlify.com/t/problem-when-navigating-routing/98037>\
**Category:** Support\
**Tags:** redirects\
**Created:** [August 1, 2023, 2:29am UTC](https://answers.netlify.com/t/problem-when-navigating-routing/98037 "2023-08-01T02:29:51Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![SamO](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/samo/32/41847_2.png) [@SamO](https://answers.netlify.com/u/SamO)\
**Post date:** [August 1, 2023, 7:00pm UTC](https://answers.netlify.com/t/problem-when-navigating-routing/98037/2 "2023-08-01T19:00:08Z")

</div>

This issue is commonly encountered when deploying single-page applications (SPAs) like React on Netlify. The problem arises because when you navigate to a different route in your application, Netlify tries to serve a file that matches that route. However, in SPAs, all routes are handled by a single `index.html` file.

To fix this, you need to add a `_redirects` file to your project with the following content:

```auto
/* /index.html 200

```

This rule tells Netlify to redirect all routes to the `index.html` file, which then allows your React router to handle the route correctly.

You should place the `_redirects` file in the `public` folder of your React application. After adding the file, you need to redeploy your application on Netlify.

Please take a look at the support guide below as it details this error in greater detail.

> [@\[Support Guide\] I’ve deployed my site but I still see "Page not found”](https://answers.netlify.com/t/support-guide-i-ve-deployed-my-site-but-i-still-see-page-not-found/125):
>
> Last reviewed by Netlify Support - August, 2023 Netlify attempts to lookup a file based on several xor filters, and when all of these fail, we end up serving a 404 page. For example, a request made to /example/ would check /example/index.html, /example.html, /example/home.html and several other combinations (not necessarily in the same order) before hitting the 404. However, in case you were not expecting a 404 at a particular URL, you might be interested in finding out the reason and potentia…

You can find more information about redirects in the [Netlify documentation](https://docs.netlify.com/routing/redirects/).

If you’re using `react-router-dom`, you might also need to switch from `BrowserRouter` to `HashRouter`, as few folks found this solved their routing issues.

---

_[View the full topic](https://answers.netlify.com/t/problem-when-navigating-routing/98037)._
