Netlify redirects with language conditions not working as expected

Viewed 177

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/, redirect to /ru/ not working.

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

[build]
  command = "yarn build"
  functions = "functions"
  publish = "dist"

[[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.

0 Answers
Related