make redirects work without mangling the host/port