Ensure hostname and port are used when rewriting path.