use right host and protocol for redirects