The redirect logic is
app.UseRewriter(new RewriteOptions().AddRedirectToHttps(StatusCodes.Status302Found, 44346));
Then when I accessed http://localhost:80/subscriptions/12345?api-version=2.0, I got:
{ "Error": { "Code": "UnsupportedApiVersion", "Message": "The HTTP resource that matches the request URI 'https://localhost:44346/subscriptions/12345?api-version=2.0' does not support the API version '2.0'." } }
But directly access to https://localhost:44346/subscriptions/12345?api-version=2.0 worked fine.