--- scuttle.orig/header.inc.php	2009-09-13 13:49:05.000000000 -0300
+++ scuttle/header.inc.php	2009-09-13 13:51:37.000000000 -0300
@@ -24,7 +24,14 @@
         $root .= '/';
     }
     $path = $root;
-    $root = 'http://'. $_SERVER['HTTP_HOST'] . $root;
+    if ($_SERVER['HTTPS'] == 'on') {
+      $protocol = 'https';
+    } elseif ($_SERVER['SERVER_PORT'] == '443') {
+      $protocol = 'https';
+    } else {
+      $protocol = 'http';
+    }
+    $root = $protocol . '://'. $_SERVER['HTTP_HOST'] . $root;
 }

 // Error codes
