detect protocol from url if present