Language redirect only working in Safari

I added the following to my _redirects file to redirect user with french language set as prefered in their browser to the French homepage:

/ /fr 302  Language=fr,fr-fr,fr-ca

It does work on Safari, but not on Chrome or Firefox. Anything I’m doing wrong?

In action:

Hi @regisphilibert,

I just tested from the latest version of Chrome and the redirect is working for me:

Can you copy the full request you were sending so I can see what the differences were?

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. :slight_smile:

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 to 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 :frowning: :

Safari result :slight_smile: :


Thanks for reaching out and providing those details. We have issues filed around the odd behavior with GoeIP redirects that our team is looking in to. We’ll update here once we have more information.

Hi @futuregerald , this thread is about prefered language redirect.

But I do have one about GeoIP: Geo redir breaks every 1/2hour or so

Always great to read you!

Sorry && thanks @regisphilibert . I love seeing you here in our community. :smile:

1 Like

I can confirm what @vict-r say.
We have the exact same issue, also that it is only working in Safari.

We tried with:
/ /de/ 301! Language=de-DE,de
/ /es/ 301! Language=es
/ /en/ 301 you actually mentioned this issue in 3 separate threads. I responded to you asking for more details in one of them. Please reply there. It’s much easier to debug in a single thread then across multiple threads. Thanks!