how can i redirect dynamic URL in worpress base on ID in htaccess or wp-config or function.php

how can i redirect dynamic URL in worpress base on ID in htaccess or wp-config or function.php

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