Cleaner code to match relative URLs

Building the URL with PHP's parse_url then passing it to
\GuzzleHttp\Url::buildUrl