[[redirects]]
from = "/*"
to = "/index.html"
status = 301
force = false
But it breaks everything, and the worst part it does so at random. For example deploy previews work perfectly but when deployed to the site they break everything.
I provided all the info I could but since this is breaking our production website for now I removed the new redirect rule in hopes of fixing it. But all the request IDs are there for you to check
Well, all non-existing pages anyways reply with a 404 status. But, I think you misunderstood and didn’t even try it once. What the above code does is, it tells Netlify to redirect all 404 errors (that is, non existing pages) that match the from string to the to string.
So, unless you’re sure about the URLs that are not going to exist, you can’t do that without 404 at least as of now. You can’t use /* wildcard entry because it will match all URLs on the domain including the root of the domain.
So, according to what I read here: How to Create Better Redirect Rules for SPAs with Netlify, the redirects you’re talking about would work only when the path exists but there’s no index.html for that path. Instead, if that path has an index.html it’ll show up.
Quoted from that page:
from = "/docs/routing/redirections"
to = "/docs/routing/redirects"
status = 301
If Netlify finds an index.html page under the path /docs/redirections it will serve that file up in place of handling the redirect. This feature is known as file shadowing. Broadly speaking, this behavior tends to be preferred when setting up redirect rules and routing in SPAs.
I assure you that we care, @ack22. Despite that, not every question has an answer, and we hadn’t gotten to yours yet since @hrishikesh seemed to be helping you out.
Looking back over the thread, I think you have diverted from your original goal:
Serve existing static pages normally.
We do that automatically, so no redirect should be needed. (you can already load appfleet edge hosting pricing with NO other configuration, if you have deploy
[[redirects]]
from = "/*"
to = "/index.html"
status = 301
force = false
I can’t easily tell which deploy you were working with 8 days ago when you wrote in, so it is hard to see into the past to understand your failure modes. But, looking at your current deploy, you have no more redirect in place like that - it’s all for specific paths.
Perhaps you could link me to a deploy where the redirect was in place, so I can see the misbehavior more directly than some out of date curl outputs you’ve posted? You can link to the deploy’s logs page in our UI to show me a specific older deploy, which I can connect to directly and examine in our database to understand what redirect got deployed and how it is working.
Thanks in advance for your help in troubleshooting!