Welcome to the forum!
From an HTTP endpoint you can return a 302 response to cause the browser to redirect to a new URL:
return anvil.server.HttpResponse(302, "", {'Location': f'{url}{query}'})
This assumes your Anvil app is set up to allow routes of some sort to go to a different form based on the URL.