title: .htaccess redirect domain.com to www.domain.com
body: <p>I am looking for a .htaccess redirect such that all request that come in for mydomain.com are redirected to www.mydomain.com. It is important tho that any sub domain request is not affected i.e. request for sub.domain.com should not be redirected.</p>
  
  <p>If found this which seems to do the opposite of what I want:</p>
  
  <pre><code>RewriteCond %{HTTP_HOST} ^www\.purchase\.
  RewriteRule (.*) http://purchase.DOMAIN_NAME/$1 [L,R]
  </code></pre>
  
  <p>Thanks in advance for your help</p>
  
  <p>Regards
  Gabriel</p>