Skip to main content

Command Palette

Search for a command to run...

React Routers Not Working with Netlify

Lets Fix this in 3 Steps !!!

Updated
1 min read
React Routers Not Working with Netlify
N

I am a software engineer intern from the UK and I have worked with multiple technologies like MERN stack, JavaScript, Python etc. I also like to contribute to open source on Github.

Table of Contents:

  • Introduction

  • Solution

  • Reference

Introduction

When you’ve deployed your React.js website to Netlify and opened the link, you see that any attempt in redirecting to another page is met with an error like this:

Solution

Follow these 3 simple steps to fix this:

  • Step 1: Go to your react app’s public folder and create a plain file called _redirects

  • Step 2: Add the following code into the _redirects file: /* /index.html 200

  • Step 3: Deploy your app again and it should fix the Netlify error

References:

https://blog.arnabghosh.me/netlify-react-router-not-working

More from this blog

Tronn

15 posts

Netlify React Router Not Working