Only in securepages: exit
diff -rup securepages-5.x-1.3/securepages.install securepages/securepages.install
--- securepages-5.x-1.3/securepages.install	2007-06-03 21:03:10.000000000 -0500
+++ securepages/securepages.install	2007-09-01 08:44:15.000000000 -0500
@@ -9,4 +9,6 @@ function securepages_uninstall() {
   variable_del('securepages_secure');
   variable_del('securepages_pages');
   variable_del('securepages_ignore');
+  variable_del('securepages_nonssl_tld');
+  variable_del('securepages_ssl_tld');
 }
diff -rup securepages-5.x-1.3/securepages.module securepages/securepages.module
--- securepages-5.x-1.3/securepages.module	2007-06-03 21:03:10.000000000 -0500
+++ securepages/securepages.module	2007-09-03 11:22:25.000000000 -0500
@@ -35,7 +35,7 @@ function securepages_menu($may_cache) {
     $items[] = array(
       'path' => 'admin/settings/securepages',
       'title' => t('Secure Pages'),
-      'description' => t('Configure which pages are and are not to be viewed in SSL'),
+      'description' => t('Configure Secure Pages'),
       'callback' => 'drupal_get_form',
       'callback arguments' => 'securepages_settings',
       'access' => user_access('administer site configuration'),
@@ -77,6 +77,21 @@ function securepages_settings() {
     '#rows' => 5,
     '#description' => t("The pages listed here will be ignored and be either returned in http or https. Enter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are '<em>blog</em>' for the blog page and '<em>blog/*</em>' for every personal blog. '<em>&lt;front&gt;</em>' is the front page."),
   );
+  $form['securepages_nonssl_subdomain'] = array(
+    '#type'           =>  'textfield',
+    '#title'          =>  t('Non-SSL Subdomain Name'),
+    '#default_value'  =>  variable_get('securepages_nonssl_subdomain', "www"),
+    '#size'           =>  25,
+    '#description'    => t("The entry here refers to the the '<em>subdomain</em>' of your site that will operate in unencrypted mode(non-SSL). Most sites will put 'www' here. For example, if you site is '<em>www.example.com</em>', then you would enter '<em>www</em>' here. Your site is accessed, in the non-SSL mode, by going to '<em>http://www.example.com</em>'"),
+  );
+
+  $form['securepages_ssl_subdomain'] = array(
+    '#type'           =>  'textfield',
+    '#title'          =>  t('SSL Subdomain Name'),
+    '#default_value'  =>  variable_get('securepages_ssl_subdomain', "www"),
+    '#size'           =>  25,
+    '#description'    => t("The entry here refers to the the '<em>subdomain</em>' of your site when you have a secure certificate installed. Most sites will put '<em>www</em>' here but this depends on the Common Name (CN) that you provided when you ordered your certificate. For example, if you ordered your certificate for your site using the CN of '<em>secure.example.com</em>', then you would enter '<em>secure</em>' here. Your site will then be accessed, during SSL modes, by going to '<em>https://secure.example.com</em>'."),
+  );
   return system_settings_form($form);
 }
 
@@ -174,22 +189,26 @@ function securepages_goto($secure) {
  *  valid url which is secure or insecure depending on the $secure flag.
  */
 function securepages_get_destination($path, $query, $secure) {
+  $nonssl_subdomain = variable_get('securepages_nonssl_subdomain', 'www');
+  $ssl_subdomain = variable_get('securepages_ssl_subdomain', 'www');
+
   if (function_exists('url')) {
     // if url() exists then use that as it will more robust.
-    $url = url($path, $query == '' ? NULL : $query, NULL, TRUE);
+    $url = url($path, $query == '' ? NULL : $query , NULL, TRUE);
   }
   else {
     // This should convert to the current page ok.
     $url = 'http://'. $_SERVER['HTTP_HOST']. $_SERVER['REQUEST_URI'];
   }
-
   if ($secure) {
-    $url = preg_replace('/^http:\/\//i', 'https://', $url);
+    #$url = preg_replace('/^http:\/\//i', 'https://', $url);
+    $url = preg_replace("/^http:\/\//i", "https://", $url);
+    $url = preg_replace("/^https:\/\/$nonssl_subdomain/i", "https://$ssl_subdomain", $url);
   }
   else {
-    $url = preg_replace('/^https:\/\//i', 'http://', $url);
+    $url = preg_replace("/^https:\/\//i", "http://", $url);
+    $url = preg_replace("/^http:\/\/$ssl_subdomain/i", "http://$nonssl_subdomain", $url);
   }
-
   return $url;
 }
 
@@ -230,3 +249,4 @@ function securepages_match($path) {
     return;
   }
 }
+
