Adding support for rewrite rules