how to handle redirects for react app page not found on netlify

Solutions on MaxInterview for how to handle redirects for react app page not found on netlify by the best coders in the world

showing results for - "how to handle redirects for react app page not found on netlify"
Nicole
14 Sep 2020
1//got to your root folder and instead of using _redirects file create a file called 
2
3netlify.toml
4
5//paste this code below in the file:
6
7[[redirects]]
8from = "/*"
9to = "/index.html"
10status = 200
11
12//save and run 
13npm run build
14
15//deploy to netlify. run this command in terminal (I'm assuming you have netlify cli indtalled already)
16netlify deploy // 
17//you will be asked a folder to dploy. type 
18build
19
20//then run 
21netlify deploy --prod
22//you will be asked a folder to dploy. type 
23build
24
25**you are done. Your application will not have broken routes if refreshed**
26  happy coding.
27