title: Apache: Permanent Redirect to HTTPS with Wildcard
body: <p>I am trying to redirect HTTP traffic to HTTPS on my server.</p>
  
  <p>I have certificates for <code>this.example.net</code>, <code>that.example.net</code> and <code>etc.example.net</code>, and I have my DNS accepting wildcards. I would like to permanently redirect HTTP to HTTPS using a wildcard.</p>
  
  <p>I have tried:</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
      ServerName example.net:80
      ServerAlias *.example.net
      ServerAdmin mark@example.net
      RedirectMatch 301 (.*) https://$1.example.net
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>but that doesn’t work.</p>
  
  <p>I know that I can set up individual subdomains this way, but is it possible to use wildcards?</p>