After installing your SSL certificate, you have the option to force all traffic to use https.
If you wish to switch manually between http and https, then you need to test the http status. The following examples show how to test for https or the lack of https.
RewriteCond %{HTTPS} on RewriteCond %{HTTPS} !=on
For example, if you want to force all visitors to use https, you could use the following:
RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R,L]