Add tests for rewrite behind the client's back with https