I was going to create a topic for my issue but I saw this post already exists so I hope OP doesn’t mind if I pile on.
I’ve pretty much abandoned trying to redirect in my .toml file and now attempting with _redirects. I’d appreciate any feedback since I’m experiencing the OP’s issue, I think.
My goal is simple. I want to redirect from
http://dev--ag-poc.netlify.com/northamerica/en for most visitors with one exception.
If the user is using Spanish (leaning towards Latin American), then redirect to
Were this to work I’d be able to add additional language re-directs that I want to support.
I learned 2 things from other posts:
- with conditions be specific first, generalize second
- use 301 instead of 302 (used w/gated content for example c.f. blog post)
So my rules are:
/ /northamerica/es 301 Language=es-419,es-CL,es-AR,es
/ /northamerica/en 301
I’m testing with MacOS with Spanish language settings, Chrome and FF are installed with Spanish language packs as default (latter is Chilean and Argentinian). Wouldn’t you know, Chrome and FF both fail and go to the English path while Safari works correctly.
I had also tried with
/ /northamerica/es 301 Language=es but it didn’t work, hence the granular attempt with the region codes.
Chrome result :
Safari result :