diff --git a/inc/actions.php b/inc/actions.php
index bebdeefcef688bc17c2633e9c8bb8e00a726b595..6d7859b6a2fe3f9a5f3b4b0010a43a2e8191cc60 100644
--- a/inc/actions.php
+++ b/inc/actions.php
@@ -357,8 +357,7 @@ function act_redirect_execute($opts){
   if($opts['fragment']) $go .= '#'.$opts['fragment'];
 
   //show it
-  header("Location: $go");
-  exit();
+  send_redirect($go);
 }
 
 /**
diff --git a/inc/common.php b/inc/common.php
index 606f107b79a3f4d72ec88476019ddf7af4bd2af8..817e416b0d0e679f704106d41bec456fcfbf1725 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -1454,4 +1454,25 @@ function is_mem_available($mem,$bytes=1048576){
   return true;
 }
 
+/**
+ * Send a HTTP redirect to the browser
+ *
+ * Works arround Microsoft IIS cookie sending bug. Exits the script.
+ *
+ * @link   http://support.microsoft.com/kb/q176113/
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+function send_redirect($url){
+    // check if running on IIS < 6 with CGI-PHP
+    if( isset($_SERVER['SERVER_SOFTWARE']) && isset($_SERVER['GATEWAY_INTERFACE']) &&
+        (strpos($_SERVER['GATEWAY_INTERFACE'],'CGI') !== false) &&
+        (preg_match('|^Microsoft-IIS/(\d)\.\d$|', trim($_SERVER['SERVER_SOFTWARE']), $matches)) &&
+        $matches[1] < 6 ){
+        header('Refresh: 0;url='.$url);
+    }else{
+        header('Location: '.$url);
+    }
+    exit;
+}
+
 //Setup VIM: ex: et ts=2 enc=utf-8 :
diff --git a/inc/media.php b/inc/media.php
index 37f73208c5eb1623e04356413b3ad2b3d9deb3a7..c932a07d4e987dfe8fbce6b372d325f4e818516b 100644
--- a/inc/media.php
+++ b/inc/media.php
@@ -201,9 +201,8 @@ function media_delete($id,$auth){
 
     if($data['unl'] && $data['del']){
         // current namespace was removed. redirecting to root ns passing msg along
-        header('Location: '.DOKU_URL.'lib/exe/mediamanager.php?msg1='.
+        send_redirect(DOKU_URL.'lib/exe/mediamanager.php?msg1='.
                 rawurlencode(sprintf(noNS($id),$lang['deletesucc'])));
-        exit;
     }
 
     return $data['unl'];
diff --git a/inc/pageutils.php b/inc/pageutils.php
index 4a62244dceed98eefe6bfc840a285ff7092da106..d3d9478cacdc29af6553bab63e02578fa7aaa9af 100644
--- a/inc/pageutils.php
+++ b/inc/pageutils.php
@@ -68,7 +68,7 @@ function getID($param='id',$clean=true){
       // fall back to default
       $id = $id.$conf['start'];
     }
-    header("Location: ".wl($id,'',true));
+    send_redirect("Location: ".wl($id,'',true));
   }
 
   if($clean) $id = cleanID($id);