301 redirect SSL problem for alias domain

I have a virtual host correctly configured with a SSL certificate and everything is workings as expected. Let’s call it site1.com

I also have another domain, site2.com that I would like to re-direct to site1.com

When I set this up using “Create virtual server / Alias of site1.com” and then visit site2.com I get an SSL error rather that a re-direct.

How can I resolve this?

Are you using Virtualmin’s SSL module to get a free SSL certificate from Lets Encrypt or have you purchased a certificate from a CA?

Hi Calport! I’m using the built in LE SSL, but aliases don’t generate an SSL so far as I can tell.

I’ve worked around the problem by creating a ‘Sub server’ and then selecting ‘Setup SSL website too’ in the options, which generates a certificate for the extra site. Then once the site is created, I went to ‘Server Configuration / website re-directs’ and setup a 301 re-direct to the destination site.

But this feels very convoluted.

But they do. If you create an alias, Virtualmin will automatically get the SSL from Let’s Encrypt for the main domain as well as the alias.

Ok I figured it out.

I had to update: system settings / server templates / default settings / website for domain

And then change ‘Create alias website by’ and select ‘Adding Server Alias to parent’

Once that change is made, created the alias with the default settings, then created the SSL from the parent website’s Lets Encrypt option my manually adding the alias domain to the SSL list.

In this screenshot, mansinghka.com is the virtual server and mansinghka.email is the alias. Note how all domains - main domain as well as alias - are automatically listed for SSL request to Let’s Encrypt.

Yes I have that now, it was the update to the template added those domains to the SSL certificate, just like your screenshot.

I have a related problem though, I’ll start a new thread to keep it focussed.

Thanks so much for you help Calpot

Glad I could be of assistance, @substandard

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.