I'm trying to redirect all http traffic for www.example.com to https://www.example.com, here's my apache2 config:
<VirtualHost *:80>
ServerAlias example.com *.example.com
ServerName www.example.com
Redirect permanent / https://www.example.com/
</VirtualHost>
which should redirect everything to:
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/example/www.example.com.crt
SSLCertificateKeyFile /etc/apache2/ssl/example/www.example.com.key
SSLCertificateChainFile /etc/apache2/ssl/example/gd_bundle.crt
ServerAlias example.com *.example.com
ServerName www.example.com
DirectoryIndex index.php
DocumentRoot /var/www/html/example/www/
...
The SSL site is working fine, but the redirect is not. I've also tried .htaccess, but apache says the rewrite is not allowed in .htaccess. I've tried numerous variations from other posts, but they don't seem to be working.