Fixed declining user when url rewriting is enabled (#289)