server: fix internal rewrite when no host in destination