Redirect all HTTP request to HTTPS

<VirtualHost *:80>  
       ServerAlias *
       RewriteEngine On
       RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [redirect=301]
</VirtualHost>  

Tagged under: apache, httpd, ssl, https, vhost