non-www to www 301 Redirection with subdomain exception
===

I see a lot of questions about it here on SO, so I'm posting here:

I have a domain www.example.com and I have set .htaccess file to redirect all example.com to www.example.com

    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

Now, I made (through my DirectAdmin) a subdomain forum.example.com and what I would like is to have all subdomain without www for eg forum.example.com and not www.forum.example.com

Thanks


