Rewrites url rebasing and rewriting in OO style.