[#1632] Only pass the protocol parameter when the qualified=True

If qualified is not True we want the URLs to be relative.