Enforcing SSL/TLS
I started offering SSL/TLS on my site with lets encrypt beta certificates, now I wanted to move to enforcing SSL/TLS.
For this I will be using mod_rewrite.
First I enabled mod_rewite
sudo a2enmod rewrite
Then edit /etc/apache2/apache2.conf and add
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https=//%{HTTP_HOST}%{REQUEST_URI}
The restart Apache and test
sudo systemctl restart apache2
Now all requests will have the URL rewritten to include https=//