fixed the url rewrite bug