title: Htaccess redirecting non-www to www
body: <p>I have searched the web all over for a good generic .htaccess script for redirecting non-www to www, and currently i'm using this:</p>
  
  <pre><code>RewriteCond %{HTTP_HOST} !^www\.
  RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [R=301,L]
  </code></pre>
  
  <p>This works fine, but if i go to a subdomain www. will be added. Does anyone has a good working redirect .htaccess script?</p>