mod_rewrite problems - redirect subdomain to different domain
- by Tom
I must have a brain freeze as I can not get my rewrite rules working.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^otherdomain\.example\.com [NC]
RewriteRule ^(.*) http://www.otherdomain.com/ [R=permanent,L]
RewriteCond %{HTTP_HOST} ^(www\.)?example\.com [NC]
RewriteCond %{REQUEST_URI} ^/otherdomain [NC]
RewriteRule ^(.*) http://www.otherdomain.com/ [R=permanent,L]
What I want is essential to redirect
otherdomain.example.com and example.com/otherdomain to otherdomain.com