Some CMS’s allow you to easily activate and use the system with SSL option. For example in WordPress you just have to enter https:// in both fields available under dashboard: settings / general.
Yet sometime you are not using such friendly CMS or maybe even you are a purist using html files based website. What you should do then?
Easy. Just create a file named .htaccess in the root of your website directory containing couple lines you will find below. That’s it.
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]