Using other Stack Overflow help questions I have tried to setup a way to redirect https and www. to my https:example.com site. I have the https redirect working but it isn't going from https://www.example.com to https://example.com.
http:www.example.com -> https:example.com ----works
http:example.com -> https:example.com ----works
https:example.com -> https:example.com ----works
https:www.example.com -> https:example.com ---- Doesnt work
Here is my config file
<VirtualHost *:80>
ServerName example.com
ServerAdmin example@gmail.com
DocumentRoot /var/www/html/example/public
<Directory /var/www/html/example>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
Redirect / https://example.com/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:80>
ServerName www.example.com
Redirect permanent / https://example.com/
</VirtualHost>
What am I doing wrong?