Remove unnecessary rewrite rules.