Fix url rewriting