Hi! I hope you are all doing well
First off, kudos to the entire Netlify team on an incredible product/platform. While I admittedly struggled at first to figure out how exactly everything works, I have gotten used to things, and I love it all.
I have a silly question, because I feel like I must be doing something wrong here and the answer is obvious but I am overthinking it hahaha.
Long story short, I have configured a few different redirects on my site (i.e. en-gb, en-ca, en-us, etc.). I have included two examples from my Netlify.toml file at the bottom of this post. Every redirect I have in there is configured in the exact same manner.
The issue I realized is if someone matches one of the redirect rules, it is impossible for them to visit a different country-specific or language-specific version of the site.
For example, someone in the United Kingdom will be redirected to domain.com/en-gb. But if they want to visit the Canadian or American versions of the site, they can’t. As if they use the country / language switcher, they will be redirected to domain.com/en-gb/en-ca.
With all that said, am I doing something wrong here and if so, is there a way for this to be fixed with Netlify? If not, do you know if it is possible through a DNS provider like Cloudflare for example?
I guess what I essentially need, using that above example again, is to switch en-gb to en-ca. Instead of having en-gb being appended before en-ca.
I feel like this must be possible. Otherwise, sites like Stripe and Shopify which have a country/language switcher would run into this same issue. Though I fully realize they more than likely have miles of code that control their respective solutions.
Thank you SO much in advance for your help!
[[redirects]]
from = "/*"
to = "/en-gb/:splat"
status = 301
force = false
conditions = {Country = ["UK"]}
[[redirects]]
from = "/*"
to = "/en-us/:splat"
status = 301
force = false
conditions = {Language = ["en"], Country = ["US"]}