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
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”