The issue lies with configuring redirects using netlify.toml or _redirects file in Gatsby project

I’m having trouble setting up any redirects using netlify.toml or _redirects.

Currently, my netlify.toml configuration looks like this:

  from = "/oferta"
  to = "/new-path"
  status = 301
  force = false
  query = {path = ":path"}
  conditions = {Language = ["en"], Country = ["US"], Role = ["admin"]}

However, the redirection from “” to “” isn’t working. The file is visible in the Netlify build files.

My current file structure in the project before the build, in the development state, looks like this:

netlify.toml <- netlify file is here

Please help me because I know how to do redirects from this level, and adding caching like _headers is essential for optimizing and working with the project.

Why have you added query and conditions? Do you need those?

"Hi Hrishikesh,

I don’t need query = {path = ":path"}. I can shorten this redirect to:

tomlCopy code

  from = "/oferta"
  to = "/new-path"
  status = 301
  force = true

And that won’t work properly."

Thanks for following up and providing this info! Can you please share the name of the site you’re having issues with so that we can look into this further?