Greetings
We are running SME Server 9.1 for email and webserver. Just installed 9.1,as our old email serve had been 7.x. Everything is working well. Got a free certificate from Letsencrypt. People can connect to the web site with either http or https. If they use http, I would like to redirect then to https, just as what happens when you access webmail.
I found this link
https://wiki.contribs.org/Https_redirectionand followed the instructions. This was written for SME 7.x I believe. I tried all three methods indicated. I did not get any error messages, but the redirection does not work. One thing that seems curious is that after expanding the templates the file /etc/httpd/conf/httpd.conf does not change. It is the same size and date as yesterday even though I have expanded the template, run signal-event post-upgrade and rebooted several times. The instructions in the link indicate to put the custom template in /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts. I ahve done this even though I don't have Virtual Hosts. I have also moved it to /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/ and that had no effect.
I am happy to redirect all http traffic to https. The template suggested in the link is as follows
{
if ($port ne "443")
{
$OUT .= <<'HERE';
# Redirect transmission Address to Secure Address
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
## End Of Redirect
HERE
}
}
Any suggestions for redirecting http to https are appreciated.
Mike