Fixed url rewrite error under some configurations