On Apache, to redirect everything that comes in to port 80 to port 443, insert the following into the Apache config file (usually /etc/httpd/conf/httpd.conf). This should be added between the or tags for the site you wish to alter.
Modify /etc/httpd/conf/httpd.conf :
RewriteEngine on
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [L,R]
Then restart Apache. That’s it. All traffic should now be redirected to use SSL.