Added ability to rewrite domain