As suggested here, I am using the following code in the Apache configuration file (default-ssl.conf in this case)
<VirtualHost *:80>
ServerName name.domain.com
Redirect / https://name.domain.com/
</VirtualHost>
I've restarted Apache and... nothing. No error, no redirect. Http is served as http, https is served as https. What did I do wrong? My domain name doesn't start with "www" but I can't imagine that making a difference.
Not sure if this helps, Also some time the browsers dose DNS cache try clearing it, in chrome you can goto chrome://net-internals/#dns and clear it, or use another browser to test.
<VirtualHost *:80>
DocumentRoot /home/webroot/example.com/htdocs
ServerName example.com
ServerAlias www.example.com
<Directory /home/webroot/example.com/htdocs>
FileETag MTime Size
DirectoryIndex index.php index.html index.htm
AllowOverride All
Order allow,deny
Allow from all
</Directory>
RewriteEngine on
Redirect permanent / http://www.example.com/
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
ErrorLog /home/webroot/example.com/logs/error_log
CustomLog /home/webroot/example.com/logs/access_log combined
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /home/webroot/example.com/htdocs
ServerName www.example.com
RewriteEngine on
Redirect permanent / http://www.example.com/
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
ErrorLog /home/webroot/example.com/logs/error_log
CustomLog /home/webroot/example.com/logs/access_log combined
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>