private function setRequestURI()
    {

        if (!isset($_SERVER['REQUEST_URI']) || !isset($_SERVER['SCRIPT_NAME']))
        {
            $this->request_uri = '';
        }
        else
        {

            $uri = $_SERVER['REQUEST_URI'];
            $script = $_SERVER['SCRIPT_NAME'];

            if (strpos($uri, $script) === 0)
            {
                $uri = substr($uri, strlen($script));
            }
            elseif (strpos($uri, dirname($script)) === 0)
            {
                $uri = substr($uri, strlen(dirname($script)));
            }

            if (strncmp($uri, '?/', 2) === 0)
            {
                $uri = substr($uri, 2);
            }

            $parts = preg_split('#\?#i', $uri, 2);
            $uri = $parts[0];

            if ($uri == '/' || empty($uri))
            {
                $this->request_uri = '';
            }

            $uri = parse_url($uri, PHP_URL_PATH);
            $this->request_uri = str_replace(array('//', '../'), '/', trim($uri, '/'));
        }
    }