I just installed lets encrypt (using this guide). In the step where I could choose to force all requests to redirect to https and I chose no…
How can now I edit the Apache2 configuration in /etc/apache2/sites-available to redirect all the http to https only forthis specific domain?
After running sudo certbot --apache -d scti.gr -d www.scti.gr I have 2 .conf files in the sites-available folder. One that I had created scti.gr.conf and now I have one more scti.gr-le-ssl.conf
Should I edit my scti.gr.conf as:
<VirtualHost *:80>
ServerName www.example.com
Redirect / https://www.example.com/
</VirtualHost>
<VirtualHost *:443>
//copy here the content that exists in scti.gr-le-ssl.conf
</VirtualHost>
I would do the redirect in your scri.gr.conf, like you have already done. Don’t copy contents from the autogenerated config file into the other one, as both will be read by the webserver anyway.
Above conf will redirect requests to http://scti.gr and http://www.scti.gr to https://scti.gr if you for example want to redirect http://scti.gr to https://scti.gr and http://www.scti.gr to https://ww.scti.gr use this conf: