protected function fixFileRoute($route)
    {
        if (! $this->pages_dir) {
            throw new RuntimeException('No pages directory specified.');
        }

        $page = realpath($this->pages_dir . $route);

        if ($this->pageExists($page)) {
            return $page;
        }

        if ($this->isFileRoute($this->not_found_route)) {
            return $this->pages_dir . $this->not_found_route;
        }

        return $this->not_found_route;
    }