Try HTTP HEAD method first for function geturl().