Properly derive the host of a URL