title: htaccess Redirect Wildcard Subdomains to https (Including www)
body: <p>Currently my htaccess file redirects non-https requests for all of my subdomains to https... except for www requests. I.e. <code>http://subdomain.example.com</code> gets redirected to <code>https://subdomain.example.com</code> (this is correct) but <code>www.subdomain.example.com</code> get redirected to <code>https://www.subdomain.example.com</code> (not correct). Here's my .htaccess code:</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
      &lt;IfModule mod_negotiation.c&gt;
          Options -MultiViews
      &lt;/IfModule&gt;
  
      RewriteEngine On
  
      # Redirect Trailing Slashes...
      RewriteRule ^(.*)/$ /$1 [L,R=301]
  
      # Trying to redirect to https
      RewriteCond %{HTTPS} off
      RewriteCond %{SERVER_PORT} !=443
      RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,NE,R=301]
  
      # Handle Front Controller...
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule ^ index.php [L]
  
  &lt;/IfModule&gt;
  </code></pre>