Made urlRewriter more flexible