Below we are going to show you how to redirect all non-https request to use https. Why would you do this? This depends on what kind of site you are hosting. For example, if you are running a billing site, and you want to ensure that all trafic is secure, you can use the following code in your htaccess file to make sure that happens.
1) Edit/Create a htaccess file in the folder your site is being served from (normally public_html).
2) Add the following code to the htaccess file.
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
|
3) Save the file and check the results in your web browser by trying to access your site using standard http rather than https. If it is working correctly, you should be automatically redirected to https.
Please Note: If you do not have a SSL certificate on your site, this could cause errors. Please make sure that you have a SSL certificate installed and properly working before attempting this.