How to redirect with a specific query parameter?

I need to redirect links with query params like this:
/index.php?x=7065

I have this in netlify.toml:

[[redirects]]
from = “/index.php”
to = “/target/path”
status = 301
force = false
query = {x = “7065”}

But that does not work.

File-based configuration | Netlify Docs explains how to do it for any value of a query parameter, not for a specific one like in my case.

Any advice?

The query parameter mentioned in docs is supposed to be for the source URL as far as I know. For example, with the query parameter specified, the redirect will occur only when that specific query exists and not otherwise.

If you wish to send query parameter, you should include it with the target path like /target/path?x=7065.