I'm having an issue with apache2. I would like to redirect both port 80 to port 443 but also redirect non www to www.
In the following config I have the http to https redirection working fine:
<VirtualHost *:80>
Redirect permanent / https://www.example.com/
</VirtualHost>
<VirtualHost *:443>
ServerName www.example.com
DirectoryIndex index.html
...
</VirtualHost>
The problem is this I can redirect http to https fine, however when I go to https://example.com
it does not redirect to https://www.example.com
Can anyone help me with this issue?