Language-based redirect only works when 1 browser language set

any update about this? we have a lot of problems width this…

hi existo, i responded to you here:

Thanks for your reply.

Everything is described in this topic:

Yes, so, as Perry said on 2 July, no status change as yet. We will follow up here when there is one - we are as anxious as you are and will not forget this thread :slight_smile:

Hello,

Any update about this? We are struggling to implement reliable redirects based on language or country

Best regards,
Paul

Hey Paul,

Country redirects should be swimming with their head well above water. If you’re having issues specifically with these, please create a topic.

As for language redirects… we mean it when we say we’ll be sure to feed back once there’s developments! :smiley:

We implemented a solution based on netlify’s functions that works with Accept-Language with multiple locales and quality.

We had to hook the function to /redirect/* because using /* was causing a infinite redirect loop in our case.

Hope this proves useful for other folks!

thank you for sharing!!

Any update on this getting fixed. This basically makes Language redirection worthless. Also this appears to have been an issue since 2019…

Hi @jclusso,

Sorry to say, but the issue is still relevant at the moment.

I don’t see how you could ever get something like this to work if you want EN to be at the root and other langes to be in subdirectories.

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