_redirect file not working for SPA created using create-react-app

I have read through a bunch of other posts with related issues but no solutions offer seem to work. I am trying to get _redirects to do its job for a SPA.

The _redirects file contains only the line:
/* /index.html 200

It is located in the /public folder in my repo, then after build is at the top of the build directory, at the same level as index.html.

In my deploy logs it says " 1 redirect rule processed ", so it seems that the rule is at least being processed, but the issues still persist.

The url is https://macka.netlify.app/
Thanks for any help

Do you have the repo to view, please?

I forked this, ran it through all the troubleshooting I know and nothing worked either.
EXCEPT:
When moving the redirect into a netlify.toml file, using:
[[redirects]]
from = “/*”
to = “/index.html”
status = 200
force = false

seemed to work… Maybe someone can jump in and explain why you’re _redirects file is not working as I too could see it in the build and being processed etc.

I made a PR here : https://github.com/macka4444/design-portfolio/pull/3
You don’t have to use it though, feel free to remove.

Thanks for the help Aaron!

Hi, @macka4444. The redirect you are using should be working but it is not.

Would you please test making a new deploy now with the rule exactly as you have it?

This should reset the redirects being used and should (and hopefully “will”) resolve this issue. If a new deploy doesn’t resolve it, please let us know.

1 Like