I am running Apache witha redirect rule like this:
RewriteCond %{HTTP_HOST} ^1st-domain\\.com RewriteRule ^(.*)$ http://2nd-domain.com$1 [R=permanent,L]
This worked for me:
RewriteCond %{HTTP_HOST} ^(www\.)?1st-domain\.com$ RewriteCond %{REQUEST_URI} ^/$ RewriteRule .* http://3rd-domain.com/ [L,R=permanent] RewriteCond %{HTTP_HOST} ^.*$ RewriteRule .* http://2nd-domain.com%{REQUEST_URI} [L,R=permanent]
whitout the quotes on the empty validation