Encode referrer