Fixed handling of relative redirects.

Thanks @kylef!