Index: includes/bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.269
diff -u -r1.269 bootstrap.inc
--- includes/bootstrap.inc	31 Jan 2009 16:50:56 -0000	1.269
+++ includes/bootstrap.inc	21 Feb 2009 12:59:22 -0000
@@ -885,7 +885,14 @@
  */
 function request_uri() {
 
-  if (isset($_SERVER['REQUEST_URI'])) {
+  // ISAPI_Rewrite cannot set REQUEST_URI in IIS, but provides the same value
+  // via HTTP_X_REWRITE_URL and allows us to build Apache compatibility in the
+  // following way.
+  // For more information see http://www.helicontech.com/isapi_rewrite/doc/concept.htm.
+  if (isset($_SERVER['HTTP_X_REWRITE_URL']) && strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== FALSE) {
+    $uri = $_SERVER['HTTP_X_REWRITE_URL'];
+  }
+  elseif (isset($_SERVER['REQUEST_URI'])) {
     $uri = $_SERVER['REQUEST_URI'];
   }
   else {
