diff --git a/include/class.http.php b/include/class.http.php
index 8d4e7be204c6e5f5942593e043105fe44ce78211..5502e9849567ce02cc4711bb52fdca3999a1ac6e 100644
--- a/include/class.http.php
+++ b/include/class.http.php
@@ -40,10 +40,15 @@ class Http {
        	print $content;
         exit;
     }
-	
-	function redirect($url,$delay=0,$msg='') {
 
-        if(strstr($_SERVER['SERVER_SOFTWARE'], 'IIS')){
+    function redirect($url,$delay=0,$msg='') {
+
+        $iis = strpos($_SERVER['SERVER_SOFTWARE'], 'IIS') !== false;
+        @list($name, $version) = explode('/', $_SERVER['SERVER_SOFTWARE']);
+        // Legacy code for older versions of IIS that would not emit the
+        // correct HTTP status and headers when using the `Location`
+        // header alone
+        if ($iis && version_compare($version, '7.0', '<')) {
             header("Refresh: $delay; URL=$url");
         }else{
             header("Location: $url");