The simple rules below make www use other than subdomains.
RewriteCond %{HTTP_HOST} =name.domain [NC] RewriteRule ^(.*)$ http://www.name.domain/$1 [R=301,L]
Edit and paste it, restart apache.
I explain:
RewriteCond %{HTTP_HOST} =name.domain [NC] matches only when someone enters name.domain (your domain name).
When subdomain.name.domain RewriteCond types are false and are not redirected. You understand? In the rule that you previously posted, you were matched for! (Not) ^ (starting at) www and subdomain.name.domain are satisfied with RewriteCond and this is what you don't want. :)
source share