M
M
mrkmx2019-10-16 11:05:36
URL Handling
mrkmx, 2019-10-16 11:05:36

Why don't redirects with language conditions work in Netlify?

I'm trying to set up redirects via netlify.toml
Expected behavior on the main page /:

  • User with any browser language is redirected to/en/
  • The user with the Russian language of the browser is redirected to/ru/

Current behavior:
  • All users are redirected to/en/

Mine netlify.toml(I quote in full so that there is more information, the redirects of interest are the last 2 sections):
[build]
  command = "yarn build"
  functions = "functions"
  publish = "dist"


  from = "/register"
  to = "https://domain.tld/register"


  from = "/login"
  to = "https://domain.tld/login"


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


  from = "/"
  to = "/en/"

I tried to configure through the file _redirects, but through it it did not work at all

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question