public function setRequestUri($requestUri = null) {
        if ($requestUri === null) {
            if (isset($this->SERVER['HTTP_X_REWRITE_URL'])) { // check this first so IIS will catch
                $requestUri = $this->SERVER['HTTP_X_REWRITE_URL'];
            } elseif (
                // IIS7 with URL Rewrite: make sure we get the unencoded url (double slash problem)
                isset($this->SERVER['IIS_WasUrlRewritten'])
                && $this->SERVER['IIS_WasUrlRewritten'] == '1'
                && isset($this->SERVER['UNENCODED_URL'])
                && $this->SERVER['UNENCODED_URL'] != ''
                ) {
                $requestUri = $this->SERVER['UNENCODED_URL'];
            } elseif (isset($this->SERVER['REQUEST_URI'])) {
                $requestUri = $this->SERVER['REQUEST_URI'];
                // Http proxy reqs setup request uri with scheme and host [and port] + the url path, only use url path
                $schemeAndHttpHost = $this->getScheme().'://'.$this->getHttpHost();
                if (strpos($requestUri, $schemeAndHttpHost) === 0) {
                    $requestUri = substr($requestUri, strlen($schemeAndHttpHost));
                }
            } elseif (isset($this->SERVER['ORIG_PATH_INFO'])) { // IIS 5.0, PHP as CGI
                $requestUri = $this->SERVER['ORIG_PATH_INFO'];
                if ( ! empty($this->SERVER['QUERY_STRING'])) {
                    $requestUri .= '?'.$this->SERVER['QUERY_STRING'];
                }
            } else {
                return $this;
            }
        } elseif ( ! is_string($requestUri)) {
            return $this;
        } else {
            // Set GET items, if available
            if (false !== ($pos = strpos($requestUri, '?'))) {
                // Get key => value pairs and set $_GET
                $query = substr($requestUri, $pos + 1);
                parse_str($query, $vars);
                $this->setQuery($vars);
            }
        }

        $this->_requestUri = $requestUri;
        return $this;
    }