I have a React site (https://60a7aa28463caaecf29c7f7f--refcode.netlify.app/) which is behaving inconsistently depending on the environment.
Here is what I’m seeing in the different contexts.
- React pages 404 (https://60a7aa28463caaecf29c7f7f--refcode.netlify.app/volunteer-opportunities)
- Static pages work (https://60a7aa28463caaecf29c7f7f--refcode.netlify.app/pages/patternlibrary.html)
Local Dev (
- React pages work (http://localhost:8888/volunteer-opportunities)
- Static pages work (http://localhost:8888/pages/patternlibrary.html)
netlify build && serve -s build
- Clicking on a link from react root to a static page creates an infinite redirect loop (http://localhost:5000 → http://localhost:5000/pages/patternlibrary.html)
- Directly entering a static page URL redirects to the wrong place (http://localhost:5000/pages/patternlibrary.html → http://localhost:5000/pages/patternlibrary)
- React pages work (http://localhost:5000/volunteer-opportunities)
Going directly or by link to
/index.htmlcreates an infinite redirect loop (http://localhost:5000/index.html → http://localhost:5000/ → http://localhost:5000/ → etc)
If I had the exact same problems in all three places I’d have a better idea of how to move forward, but as it is I can’t figure out what my problem is or if I have multiple problems? My main goal is to get the React pages working on production. Ideally, production would function like my local dev server!
_redirects file looks like this:
/* /index.html 200
My deploy settings look like this:
npm run build
Deploy log visibility
Logs are public