client rewrite