Improving HTTPS redirection