Redirect to HTTPS

SYSTEM INFORMATION
OS type and version UBUNTU 22.04
Webmin version 2.021
Virtualmin version 7.7 PRO
Related packages SUGGESTED

Hello, I am trying to make my website redirect to HTTPs all the time. I have seen some instructions in forum but they look to be for older versions of Virtualmin and do not work. I tried Server Templates → Default Settings → Website for Domain → Redirect all HTTP requests to HTTPS.
but this does not work for me. Any ideas?
Thank you so much

This will apply to all future virtual servers that you create in Virtualmin.

You can enable HTTPS redirect under Virtualmin → Server configuration → Website options → Redirect all request to SSL Site

This will enable redirect of your traffic to https and this is the most cleanest way to do it.

You can also configure redirect in .htaccess file under your website folder, but I guess there are some problems when requesting SSL certificate from letsencrypt.

Key assumption here is that you actually have a valid LE certificate (Server Configuration -> SSL Certificate)

then it might depend on your setting on the webserver you are using (Apache or Nginx) the default settings are good enough but you may have changed them and they can be changed by the pages loaded on the website, especially by a redirect. (put up a dummy “Hello World” page and test using that.

Check in Server Configuration -> Website Options -> Redirect all requests to SSL site and also ensure there are no changes in Server Configuration -> Website Redirects there should only be one Http protocol to “/$1 with HTTPS”

Thank you, it works

is this the correct configuration of my https://thenet4you.net ???

Edit Server Template
Default Settings
Edit template section:
SSL website for domain

SSL website for domain
Template for private key path

File in home directory

Custom path
Template for certificate path

File in home directory

Same directory as key file

Custom path
Template for CA certificate path

File in home directory

Same directory as key file

Custom path
Template for combined certificate path

File in home directory

Same directory as key file

Custom path
Template for key and certificates path

File in home directory

Same directory as key file

Custom path
Configure Webmin to use same SSL cert
Yes

No
Configure Usermin to use same SSL cert
Yes

No
Configure Dovecot to use same SSL cert
Yes

No
Configure Postfix to use same SSL cert
Yes

No

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