Reputation: 75
I wish to redirect an entire domain except for 1 subdomain to another site.
I'm trying to get:
to redirect to another website/domain.
I want subdomain.domain.com to remain unaffected.
So far I have only managed to get either the www or the non www versions to redirect but not both at the same time.
Any assistance would be much apreciated.
Upvotes: 2
Views: 3026
Reputation: 13755
RewriteEngine On
RewriteCond %{HTTP_HOST} !^subdomain\.domain\.com
RewriteRule ^(.*)$ http://www.another-domain/$1 [R=301,L]
Upvotes: 6