Assuming you want to forward old traffic from old domain olddomain.com to new domain newdomain.com, use the following .htaccess file:


<IfModule mod_rewrite.c>
RewriteEngine On
Options +FollowSymLinks
RewriteBase /
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^(www\.)?olddomain\.com$ [NC]
RewriteRule (.*) https://www.newdomain.com/$1 [R=301]
RewriteCond %{HTTPS} !on
RewriteCond %{HTTP_HOST} ^(www\.)?olddomain\.com$ [NC]
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]
</IfModule>