Hello, I’m really new to react and netlify and I’m having issues deploying my react app to my newly created domain with a 404 page not found error. I’ve come to understand that our “index.html” file must be at the root of my repository for the site to deploy properly, however the index.html file usually is created and placed in the “public” folder of react applications, and I’m not sure how to remove it from that folder without causing errors. Is there any way to direct the root to the index.html in the public folder?
Hi @GabLikesCoffee, in addition to @coelmay’s answer, in case you are using React Router or any other client side routing package, kindly add a _redirects file inside the /public folder like /public/_redirects . After add the contents below in the _redirects file and then redeploy again to see if it works.
/* /index.html 200
The above is stated in the Deployment section at the second link @coelmay posted. However I am specifically stating it here again in case you missed it since the documentation states configuration for client-side routing which might escape or confuse most people reading the documentation.