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