rewriteGateway