Add support for rewrite rules