Encode Links for DB