Fix setting protocol and host in redirects