diff --git a/htaccess.admin.inc b/htaccess.admin.inc
index 1c820bf..766adb4 100755
--- a/htaccess.admin.inc
+++ b/htaccess.admin.inc
@@ -43,6 +43,19 @@ function htaccess_settings($form, $form_state) {
     '#default_value' => variable_get('htaccess_settings_symlinks', 'FollowSymLinks'),
   );
 
+  $htaccess_settings_ssl_options = array(
+    'HTTPS_mixed_mode' => t('Enable mixed-mode HTTP/HTTPS (allow trafic from both HTTP and HTTPS'),
+    'HTTPS_force_redirect' => t('Enable HTTPS and redirect all HTTP trafic (force all trafic through HTTPS protocol only)'),
+  );
+
+  $form['htaccess_settings']['htaccess_settings_ssl'] = array(
+    '#type' => 'radios',
+    '#title' => t('HTTP Secure (HTTPS)'),
+    '#description' => t('Before activating the HTTPS support, you should first get a valid certificate, then configure your web server.<br />For more informations, see <a href="@link_ssl" target="_blank">https://www.drupal.org/https-information</a>.', array('@link_ssl' => url('https://www.drupal.org/https-information'))),
+    '#options' => $htaccess_settings_ssl_options,
+    '#default_value' => variable_get('htaccess_settings_ssl', 'HTTPS_mixed_mode'),
+  );
+
   $form['htaccess_settings_custom'] = array(
     '#type' => 'fieldset',
     '#title' => t('Custom settings'),
@@ -431,30 +444,32 @@ function htaccess_admin_settings_generate_submit($form, &$form_state) {
 
   $redirection_config = variable_get('htaccess_settings_url_prefix_redirection', 'without_www');
 
+  $ssl_config = (variable_get('htaccess_settings_ssl', 'HTTPS_mixed_mode'); == 'HTTPS_mixed_mode' ? "%{ENV:protossl}" : "s");
+
   $boot_rules = variable_get('htaccess_settings_boost_module_rules', '');
 
   switch ($redirection_config) {
     case 'without_www':
       $without_www_config = "RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]" . PHP_EOL;
-      $without_www_config.= "RewriteRule ^ http%{ENV:protossl}://%1%{REQUEST_URI} [L,R=301]" . PHP_EOL;
+      $without_www_config.= "RewriteRule ^ http". $ssl_config ."://%1%{REQUEST_URI} [L,R=301]" . PHP_EOL;
       $with_www_config = "#RewriteCond %{HTTP_HOST} ." . PHP_EOL;
       $with_www_config .= "#RewriteCond %{HTTP_HOST} !^www\. [NC]" . PHP_EOL;
-      $with_www_config .= "#RewriteRule ^ http%{ENV:protossl}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]" . PHP_EOL
-    break;
+      $with_www_config .= "#RewriteRule ^ http". $ssl_config ."://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]" . PHP_EOL
+      break;
     case 'with_www':
       $without_www_config = "#RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]" . PHP_EOL;
-      $without_www_config.= "#RewriteRule ^ http%{ENV:protossl}://%1%{REQUEST_URI} [L,R=301]" . PHP_EOL;
+      $without_www_config.= "#RewriteRule ^ http". $ssl_config ."://%1%{REQUEST_URI} [L,R=301]" . PHP_EOL;
       $with_www_config = "RewriteCond %{HTTP_HOST} ." . PHP_EOL;
       $with_www_config .= "RewriteCond %{HTTP_HOST} !^www\. [NC]" . PHP_EOL;
-      $with_www_config .= "RewriteRule ^ http%{ENV:protossl}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]" . PHP_EOL
-    break;
+      $with_www_config .= "RewriteRule ^ http". $ssl_config ."://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]" . PHP_EOL
+      break;
     default:
       $without_www_config = "#RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] " . PHP_EOL;
-      $without_www_config.= "#RewriteRule ^ http%{ENV:protossl}://%1%{REQUEST_URI} [L,R=301]" . PHP_EOL;
+      $without_www_config.= "#RewriteRule ^ http". $ssl_config ."://%1%{REQUEST_URI} [L,R=301]" . PHP_EOL;
       $with_www_config = "#RewriteCond %{HTTP_HOST} ." . PHP_EOL;
       $with_www_config .= "#RewriteCond %{HTTP_HOST} !^www\. [NC]" . PHP_EOL;
-      $with_www_config .= "#RewriteRule ^ http%{ENV:protossl}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]" . PHP_EOL;
-    break;
+      $with_www_config .= "#RewriteRule ^ http". $ssl_config ."://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]" . PHP_EOL;
+      break;
   }
 
   $symbolic_links_config = variable_get('htaccess_settings_symlinks', 'FollowSymLinks');
@@ -471,6 +486,7 @@ function htaccess_admin_settings_generate_submit($form, &$form_state) {
       break;
   }
 
+
   $search = array("%%%rules_before%%%", "%%%symbolic_links%%%", "%%%with_www%%%", "%%%without_www%%%", "%%%boost_rules%%%");
   $replace = array($rules_before_config, $symbolic_links_config, $with_www_config, $without_www_config, $boot_rules);
 
diff --git a/includes/htaccess.txt b/includes/htaccess.txt
index 587c217..d65d31e 100755
--- a/includes/htaccess.txt
+++ b/includes/htaccess.txt
@@ -59,9 +59,7 @@ DirectoryIndex index.php index.html index.htm
   # Set "protossl" to "s" if we were accessed via https://.  This is used later
   # if you enable "www." stripping or enforcement, in order to ensure that
   # you don't bounce between http and https.
-  RewriteRule ^ - [E=protossl]
-  RewriteCond %{HTTPS} on
-  RewriteRule ^ - [E=protossl:s]
+  %%%ssl_config%%%
 
   # Make sure Authorization HTTP header is available to PHP
   # even when running as CGI or FastCGI.
