title: Redirect only HTTP subdomain to HTTPS subdomain in htaccess
body: <p>How do you redirect only the HTTP subdomain to HTTPS subdomain in <code>.htaccess</code>? The main site is in WordPress and already redirected to HTTPS with a plugin, but the subdomain is a PHP created site. I have looked and not seen a conclusive solution to this on here.</p>
  
  <p>I copy and pasted this suggested code but it did nothing:</p>
  
  <pre><code>#Redirect Subdomain
  RewriteEngine on
  RewriteCond %{HTTP_HOST} ^subdomain\.example\.com$ [NC]
  RewriteRule .? https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
  </code></pre>