Only redirect is there is no query string

Is there any way to add a 301 redirect that only matches if there is no query parameters added to the URL?

For example if I’ve got the following redirect

/test /test1 301!

and I go to https://www.example.com/test?hello=world then it will redirect to https://www.example.com/test1?hello=world but I only want to redirect if someone specifically goes to https://www.example.com/test (no query parameter).

hi reasonmark, i don’t believe this is possible with Netlify’s redirects engine, no - at present, no logic or regex is possible in redirects. I wish i had better news!