Fix rewrite http host function