When your web server starts Apache, you can use modRewrite to do this.
Add this to .htaccess , which should be located in the root of the http domain
RewriteEngine on RewriteCond %{SERVER_PORT} !^443$ RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,L]
source share