Added support for redirects on hosts with non-default ports