Viewing site over http and https are both working but prefer to configure it so that ALL visitors ONLY go through the SSL connection so that it always start with https://www.example.com - what am I missing?
I'm trying to do the following:
visit http ://example.com and go to https ://www.example.com
visit http ://www.example.com and go to https ://www.example.com
visit https ://example.com and go to https ://www.example.com
I created and enabled the file name examplesite (see below) in the folder /etc/apache2/sites-available
<VirtualHost example.com:80>
ServerName www.example.com
ServerAlias example.com
Redirect permanent / https://www.example.com/
</VirtualHost>
<VirtualHost www.example.com:443>
ServerName www.example.com
DocumentRoot /var/www/example.com/public_html
...
...
</VirtualHost>