Redirect URL: support params in redirect url

`$url = "http://blah.com?x=y" . "?Z=" . $value;`
Will obviously not work because the query part of the url now has two ?s

Previously if your url already contained query params, the generated url
would be incorrect.