Language-based redirect only works when 1 browser language set

First I’d like to confirm that the issue is still there. If I there is more than one language in the Accept-Language header, the redirects do not work.

Here are my redirects:

/    /fr    302    Language=fr
/    /en    302    Language=en
/    /de    302

Here’s the header:

accept-language: en-US,en;q=0.9

But I am redirected to /de.

It’s also interesting that this language header is a default one (I just installed Chromium). And this means that the language redirects almost never work.

Second, I’d like to ask the Netlify team to update the relevant documentation. Could you please do this? I spent quite some time trying to understand why redirects do not work as described in the docs.

1 Like

Appreciate the feedback, @Leksat.

It’s a known limitation of our current Language-based redirects service. Country-based redirects are much more robust, if these are at all an option for you. Again, thanks for sharing your insight!

It’s a known limitation

If you add it to the docs, it will save lots of time for developers. I hope you will :slight_smile:

1 Like

I’ll pass on the feedback to our docs team, @Leksat :+1:

It would be really cool if we could use wildcards in the language condition, like:

conditions = {Language = ["ko*"]}

To catch headers like:

Accept-Language: ko,en

I love the Netlify language-based redirects, and they would be perfect if we could just account for the multiple language use case. :heart:

That’s a great suggestion!

For most websites country doesn’t matter but language does. In these cases, country based redirections are a nightmare for all countries with multiples spoken languages. I’m myself a native French speaker living in Switzerland (where French and German are both official languages) and lots of websites redirects me to the german version by default which is really annoying.
Just take a look on List of multilingual countries and regions - Wikipedia to see how spread is this issue.
And aside of all theses countries, it’s also an issue when traveling in a country with a different language.

Also currently the language redirect is not usable at all, and seems like this is an issue for more than 2 years, why it takes so long to just take the first language from the browser Accept-Language header ?

1 Like

Hey there, @Dewopak689 :wave:

Thanks so much for bringing this up and sharing your detailed feedback. We have shared your insights with one of our internal teams and they are looking into this further for you. I will follow up on this thread once I have more information!

For folks following along, our Documentation team has worked to improve the docs we have around this feature based on the feedback in this thread. Thanks to everyone who has reached out!

Related, one of our Engineering pods still has an open feature request to improve our language-based redirects. We will continue to update this thread as improvements are released.

Thanks again to everyone who has contributed here and shared ideas-- feedback is what makes our products better!! :netlisparkles:

1 Like