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 should work:
RewriteCond %{HTTP_HOST} ^1st-domain\.com
RewriteRule ^$ http://3rd-domain.com [R=permanent,L]
RewriteCond %{HTTP_HOST} ^1st-domain\.com
RewriteRule ^(.+)$ http://2nd-domain.com/$1 [R=permanent,L]
Hope it helps!
Note: REQUEST_URI is slightly different between httpd.conf and .htaccess, it starts with an extra backslash in httpd.conf. This means that in httpd.conf the first rewrite rule should be ^\/$
, not just ^$
.
On multisites such redirection works for me for empty requests :
RewriteCond %{HTTP_HOST} ^1st-domain\.com$
RewriteCond %{REQUEST_URI} "^/$"
RewriteRule ^$ http://3rd-domain.com/ [R=permanent,L]