Redirect users that visit custom subdomain without /login path and params

I have a custom domain configured on a production tenant login.mydomain.com. If a user visits https://login.mydomain.com without /login?... they are redirected to mydomain.com. Is there a way to change this redirect to be app.mydomain.com instead?