Add rewrite rules to a file