Updates for the rewrite middleware.