I have a site running at TrustHeart - Human & Heart, I have made some small changes and try to run my PR TrustHeart - Human & Heart but get 404 on all pages. When running locally it works fine and I have tried to deploy my main branch currently running in production to a new PR.
This issue started on Friday 2023-11-17. I’m not able to find out what’s going wrong, it seems like something not running in same manner as before, but I don’t know where to look for error. I build and deploying from Azure DevOps and there are no errors in the logs. I have tried to upload my local files manual as well but but same issue.
Is there any changes or issues in Netifly environment I should be aware of?
Hi, @knycket. The site’s netlify.toml file used to contain this:
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
This is commonly referred to at Netlify as the “single page application (SPA) redirect rule”. There is a support guide with more details here:
However, at some point the netlify.toml file was modified and this redirect rule was removed from that file. That is why the 404s are occurring. If you add that redirect back and trigger a new deploy, that should fix the 404s.
If not or if there are other questions, please reply anytime.
Thanks for you answer.
You pointed out the error, but I cannot understand why it goes wrong, In my package I build and deploy there is a netlify.toml with this content
[build]
command = "yarn run build"
functions = "functions"
publish = "build"
## Uncomment to use this redirect for Single Page Applications like create-react-app.
## Not needed for static site generators.
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
But when I look at the file in Netifly is look like this.