Redirects with Language conditions not working as expected

Hi, i try setup redirects in netlify.toml, but have some problems.
Expected behaviour:

  • user with any browser language must be redirected to english version .com/en/
  • user with “ru” browser language must be redirected to .com/ru/

Current behaviour:

  • All users redirected to /en/

My netlify.toml (I inserted it whole so that there is more information):

[[redirects]]
  from = "/register"
  to = "https://domain.tld/register"

[[redirects]]
  from = "/login"
  to = "https://domain.tld/login"

[[redirects]]
  from = "/"
  to = "/ru/"
  conditions = {Language = ["ru"]}

[[redirects]]
  from = "/"
  to = "/en/"

PS. I tried setup redirects within _redirects file but it not worked at all

Hi @mrkmx, with the redirect you mentioned, you weren’t setting the status. Could you try the following?

 [[redirects]]
  from = "/"
  to = "/ru/"
  conditions = {Language = ["ru"]}
  status = 301

Let me know if that changes what you see.

I tried adding status, it didn’t help

Thanks for giving it a try. We do have a number of issues around language based redirects and have an issue tracking this. We’ll update this post if and when we get the issue with language based redirects fixed.