title: Redirect https://subdomain.example.com to https://example.com/subdomain
body: <p>I'm trying to redirect traffic, and I've managed to make it work on <code>HTTP</code> with this:</p>
  
  <pre><code>RewriteEngine On
  RewriteCond %{HTTP_HOST} ^wiki\.example\.com
  RewriteCond %{HTTPS} !=on
  RewriteRule (.*) http://example.com/wiki/$1 [L]
  RewriteCond %{HTTP_HOST} ^db\.example\.com
  RewriteCond %{HTTPS} !=on
  RewriteRule (.*) http://example.com/db/$1 [L]
  </code></pre>
  
  <p>So far I haven't gotten it to work with <code>HTTPS</code>. Anyone got any ideas?</p>