Encode url as string