Add support for custom rewrites