Cross protocol redirects

This patch allows HTTP redirects to change the protocol from HTTP to HTTPS, so long as the hostname stays the same. Previously, only redirects that started with `/` were allowed.