Avoid hardcoded http URLs for redirects (#772)