How can I add_rewrite_rule for a custom post type to preserve the referral id

How can I add_rewrite_rule for a custom post type to preserve the referral id

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)