In frappe, I am setting the redirections in hooks.py as follows:
website_redirects = [
...
{ "source": "/login", "target": "/entrar" },
However, I had many difficulties to setup a working redirection that included a property. For example, from /login?redirect-to=other-page to /entrar?redirect-to=other-page, the parameter was not passed.
I finally found a solution, but since I did not find any help online and spent several hours to find it, I thought I would post it here to save time to anybody facing a similar problem.
The solution eventually was to combine the (barely documented) property
"match_with_query_string": Trueand some regex: