fix url rewriting