SSL redirect not directly to the main domain?

I added a server and an alias server with Let's encrypt SSL certs. On this server a Wordpress mutliblog installation is running, where blogs can have individual domains.

The Apache config got generated like this:

<VirtualHost *:80>
ServerName abc.de
ServerAlias www.abc.de
ServerAlias xyz.ms
ServerAlias www.xyz.ms
RewriteEngine on
RewriteRule ^(.*)$ https://abc.de/$1 [R,L]
</VirtualHost>
<VirtualHost *:443>
...
</VirtualHost>

But for the Wordpress domain mapping we need it with a variable HTTP_HOST instead of the fixed server name:

<VirtualHost *:80>
ServerName abc.de
ServerAlias www.abc.de
ServerAlias xyz.ms
ServerAlias www.xyz.ms
RewriteEngine on
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R,L]
</VirtualHost>
<VirtualHost *:443>
...
</VirtualHost>

Is there a way to achieve this with Virtualmin?

Status: 
Active

Comments

Howdy -- I don't believe there's a way to do that within Virtualmin currently (though Jamie will correct me if I'm wrong).

However, does it work to manually tweak the rewrite config as you just showed there?

Virtualmin shouldn't interfere with that once it's created, so any changes you make like that should work well.

Yup, you should be good, Virtualmin shouldn't change that on it's own.