How can I redirect HTTP to HTTPS with a local self assigned SSL certificate in my .htaccess? I'm having trouble redirecting HTTP to HTTPS with a self assigned SSL certificate generated by MAMP PRO using the following code in my .htaccess:

RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}


or

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}


I have also tried the patrol plugin for Craft, enabling/disabling dev mode and included  'enableCsrfProtection' =&gt; true, in my general.php

Also the .htaccess provided by Craft doesn't work for me.
The condition should be:

RewriteCond %{HTTPS} !=on


(You were missing the = sign.)

For more info, see our help article, How do I force SSL for CP requests?