Handling empty host in URLs