Redirect custom post type from one domain to another domain

Try something like the following at the top of your .htaccess file at sample.com:

RewriteEngine On

RewriteRule ^code/. https://www.someotherdomain.com%{REQUEST_URI} [R,L]

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