Handling cases with empty host in url