public function resolveFilePath($requestUrl)
    {
        $contentDir = $this->getConfig('content_dir');
        $contentExt = $this->getConfig('content_ext');

        if (!$requestUrl) {
            return $contentDir . 'index' . $contentExt;
        } else {
            // prevent content_dir breakouts
            $requestUrl = str_replace('\\', '/', $requestUrl);
            $requestUrlParts = explode('/', $requestUrl);

            $requestFileParts = array();
            foreach ($requestUrlParts as $requestUrlPart) {
                if (($requestUrlPart === '') || ($requestUrlPart === '.')) {
                    continue;
                } elseif ($requestUrlPart === '..') {
                    array_pop($requestFileParts);
                    continue;
                }

                $requestFileParts[] = $requestUrlPart;
            }

            if (!$requestFileParts) {
                return $contentDir . 'index' . $contentExt;
            }

            // discover the content file to serve
            // Note: $requestFileParts neither contains a trailing nor a leading slash
            $requestFile = $contentDir . implode('/', $requestFileParts);
            if (is_dir($requestFile)) {
                // if no index file is found, try a accordingly named file in the previous dir
                // if this file doesn't exist either, show the 404 page, but assume the index
                // file as being requested (maintains backward compatibility to Pico < 1.0)
                $indexFile = $requestFile . '/index' . $contentExt;
                if (file_exists($indexFile) || !file_exists($requestFile . $contentExt)) {
                    return $indexFile;
                }
            }
            return $requestFile . $contentExt;
        }
    }