Reputation: 91
I am trying to learn how to fix the following issue.
The site works find if I use buttons to navigate.
Solutions that I have tried so for :
_redirects was added to the root folder with /* /index.html 200
built and re-deployed. Did Not Work
netlify.toml was added to root folder [[redirects]] from = "/*" to = "/" status = 200
built and re-deployed Did Not Work
Take a look at my files : https://github.com/swappybizz/routing_refresh_on_deployment/
Upvotes: 0
Views: 3689
Reputation: 91
There is a useful tutorial by hBlev : https://www.youtube.com/watch?v=e6qXUS3C550 where at 10:00 , it has been explained the following :
Index.html
Public
directory gets build and src
gets bundled._redirects
has to be in the Public
directory for the routing to work on refresh or manual loading/* /index.html 200
is a to from statusCode
and the *
represents all possibilities and it is going to redirect them to index.html
which is actually the only thing served. Buth the status code 200
helps keep the /path
and not letting it redirect to the url but Render while keeping the pathdetails could be found [here]:https://docs.netlify.com/routing/overview/
Same site was redeployed to https://teal-mermaid-ada4e6.netlify.app and now routes could be refreshed or directly loaded i.e by clicking https://teal-mermaid-ada4e6.netlify.app/red
Upvotes: 6