Adds rewrite option

Adds support for rewrite option for vhosts.