Let us say you have webmail sub-domain called http://mail.nixcraft.com and you would like to redirect it to https secure connection i.e. https://mail.nixcraft.com.
This will help you protect user privacy and sensitive information such as username and password remotely.
So how do you configure your Apache web server so that you prevent your web sites from being accessed without encryption?
First make sure Apache is configured for HTTPS connection and necessary SSL certificates are installed.
Now open httpd.conf or .htaccess file (mod_rewrite not required):