[2.0] Fix URL format for appending a query string

Reversed the format for whether a query string already exists or not. Fixes #1341