public function frontControllerPath($sitePath, $siteName, $uri)
    {
        // without modifying the URI, redirect if necessary
        $this->handleRedirectBackendShorthandUris($uri);

        // from now on, remove trailing / for convenience for all the following join operations
        $uri = rtrim($uri, '/');

        // try to find the responsible script file for the requested folder / script URI
        if (file_exists($absoluteFilePath = $sitePath . $this->documentRoot . $uri))
        {
            if (is_dir($absoluteFilePath))
            {
                if (file_exists($absoluteFilePath . '/index.php'))
                {
                    // this folder can be served by index.php
                    return $this->serveScript($sitePath, $siteName, $uri . '/index.php');
                }

                if (file_exists($absoluteFilePath . '/index.html'))
                {
                    // this folder can be served by index.html
                    return $absoluteFilePath . '/index.html';
                }
            }
            else if (pathinfo($absoluteFilePath, PATHINFO_EXTENSION) === 'php')
            {
                // this file can be served directly
                return $this->serveScript($sitePath, $siteName, $uri);
            }
        }

        // the global index.php will handle all other cases
        return $this->serveScript($sitePath, $siteName, '/index.php');
    }