Fix redirection so query strings are not added multiple times