Add hostmap url rewrite function.