title: Force Subdomain to secure.domain.com rather than domain.com/secure
body: <p>I have an SSL cert on a subdomain we have (secure), however if someone attempts to access the folder using this method:</p>
  
  <p><code>http://www.domain.com/secure</code>
  or <code>https://www.domain.com/secure</code></p>
  
  <p>It shows the SSL error "ssl_error_bad_cert_domain" which is correct, so what I wanted to do was prevent anyone accessing the secure folder directly, instead forcing them to:</p>
  
  <p><code>https://secure.domain.com</code></p>
  
  <p>Which then ensures the SSL cert works correctly.</p>
  
  <p>I am assuming this can be done using the .htaccess file in the subdomain folder (which already forces it to use https), but I'm just not sure how to accomplish it.</p>
  
  <p>Many thanks.</p>
  
  <p><strong>Update 1</strong><br>
  Including current subdomains .htaccess</p>
  
  <pre><code>RewriteEngine On
  RewriteBase /
  
  RewriteCond %{HTTPS} off
  RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
  </code></pre>