Reputation: 85
This may be asked somewhere else but can't really find an answer to this one.
I want to redirect all the subdomains (*.domain.com) to the root (i.e. domain.com) using an htaccess. So in short:
test.domain.com -> domain.com
asdasdasd.domain.com -> domain.com
etc.
Thanks!
Upvotes: 0
Views: 2117
Reputation: 343
Try the following, it should work
RewriteCond %{HTTP_HOST} ([^.]+)\.domain.com [NC]
RewriteRule ^(.*) http://domain.com/
Upvotes: 3