title: Subdomain https www to non-www
body: <p>I have a domain called <code>example.com</code> and within this domain are two sub-domains called:</p>
  
  <ul>
  <li><code>qa1.example.com</code></li>
  <li><code>qa2.example.com</code></li>
  </ul>
  
  <p>All of which have SSL certification. However, I have a <code>.htaccess</code> file as follows:</p>
  
  <h2>UPDATED</h2>
  
  <pre><code>Options +FollowSymlinks
  
  Options -Indexes
  
  &lt;FilesMatch "\.(tpl|ini|log|xml)"&gt;
   Order deny,allow
   Deny from all
  &lt;/FilesMatch&gt;
  
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
  RewriteRule ^([^?]*) index.php?route=$1 [L,QSA]
  RewriteCond %{HTTPS} !=on
  RewriteRule %{HTTP_HOST} ^www\.
  RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  
  RewriteBase /
  RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
  RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
  RewriteRule ^download/(.*) /index.php?route=error/not_found [L]
  </code></pre>
  
  <p>The following happens:</p>
  
  <ol>
  <li><code>http://qa1.example.com</code> > redirects to > <code>https://qa1.example.com</code></li>
  <li><code>http://www.qa1.example.com</code> > redirects to > <code>https://www.qa1.example.com</code></li>
  <li><code>https://www.qa1.example.com</code> > redirects to > <code>https://www.qa1.example.com</code></li>
  </ol>
  
  <p>Number 1 is correct, but numbers 2 and 3 need to redirect to <code>https://qa1.example.com</code> without the <code>www</code>.</p>
  
  <p>How can this be achieved? I can include the <code>.htaccess</code> file separately for the two sub-domains.</p>