final rewrite config