Fix rewriting rules for the server