title: how to redirect www subdomain to non-www when domain is redirected to www
body: <p>My primary domain is currently permanently redirected to <strong>www.mydomain.com</strong> (non-www to www redirection), with .htaccess as follows:</p>
  
  <pre><code>RewriteCond %{HTTP_HOST} ^mydomain.com$
  RewriteRule ^/?$ "http\:\/\/www\.mydomain\.com\/" [R=301,L]
  
  RewriteCond %{HTTP_REFERER} !^http://mydomain.com/.*$      [NC]
  RewriteCond %{HTTP_REFERER} !^http://mydomain.com$      [NC]
  RewriteCond %{HTTP_REFERER} !^http://www.mydomain.com/.*$      [NC]
  RewriteCond %{HTTP_REFERER} !^http://www.mydomain.com$      [NC]
  </code></pre>
  
  <p>I would like to know how all subdomains that I'll be creating, ex. blog.mydomain.com, will be redirected to non-www, ex. <strong>blog.mydomain.com</strong>, and <em>not</em> <strong>www.blog.mydomain.com</strong>. Every time I create a subdomain and enter the non-www URL to the browser, it prompts a redirect loop.</p>
  
  <p>Hope you can help! Thanks! :)</p>