RewriteCond %{HTTP:X-HTTPS} !=1
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP:X-HTTPS} !=1
RewriteCond %{REQUEST_URI} !^/folder/folder/file.php
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]