title: Redirect all non www to www except one subdomain with htaccess
body: <p>I'd like to redirect all URLs not containing <code>www</code> to <code>www</code></p>
  
  <p>I used this:</p>
  
  <pre><code>RewriteCond %{HTTP_HOST} !^www.example.com$
  RewriteRule ^(.*) http://www.example.com$1 [QSA,L,R=301]
  </code></pre>
  
  <p>Now I need one subdomain not to be redirect like this, or I get an error.</p>
  
  <p>So I'd like to redirect any URL that does not begin with sub or with <code>www</code> to <code>www.example.com</code></p>
  
  <p>How can I do this ? thanks</p>