diff --git a/library/Zend/Controller/Request/Http.php b/library/Zend/Controller/Request/Http.php index e8e645912c..342c8d5b8b 100644 --- a/library/Zend/Controller/Request/Http.php +++ b/library/Zend/Controller/Request/Http.php @@ -390,13 +390,19 @@ public function getEnv($key = null, $default = null) public function setRequestUri($requestUri = null) { if ($requestUri === null) { - if ( + if (isset($_SERVER['HTTP_X_ORIGINAL_URL'])) { + // IIS with Microsoft Rewrite Module + $requestUri = $_SERVER['HTTP_X_ORIGINAL_URL']; + } elseif (isset($_SERVER['HTTP_X_REWRITE_URL'])) { + // IIS with ISAPI_Rewrite + $requestUri = $_SERVER['HTTP_X_REWRITE_URL']; + } elseif ( // IIS7 with URL Rewrite: make sure we get the unencoded url (double slash problem) isset($_SERVER['IIS_WasUrlRewritten']) && $_SERVER['IIS_WasUrlRewritten'] == '1' && isset($_SERVER['UNENCODED_URL']) && $_SERVER['UNENCODED_URL'] != '' - ) { + ) { $requestUri = $_SERVER['UNENCODED_URL']; } elseif (isset($_SERVER['REQUEST_URI'])) { $requestUri = $_SERVER['REQUEST_URI'];