implementing RewriteRules controller and tests