public function parse($url)
    {
        if (!$url) {
            $url = '/';
        }

        $Routes = TableRegistry::get('Wasabi/Core.Routes');

        $route = $Routes->find()
            ->orWhere([$Routes->aliasField('page_type') => 'collection'])
            ->orWhere([$Routes->aliasField('page_type') => 'simple'])
            ->andWhere([$Routes->aliasField('url') => $url])
            ->first();

        $pageNumber = false;

        $urlParts = explode('/', $url);

        // no direct route found -> try paged collection routes
        if (!$route) {
            $part = array_pop($urlParts);

            if (preg_match('/^[0-9]+$/', $part)) {
                $pageNumber = (int)$part;
                $part = array_pop($urlParts);
            }

            // paged url found so lets try to find a proper collection route
            if ($pageNumber !== false && $part === self::PAGE_PART) {
                $route = $Routes->find()->where([
                    $Routes->aliasField('page_type') => 'collection',
                    $Routes->aliasField('url') => join('/', $urlParts)
                ])->first();
            }
        }

        if (!$route) {
            return false;
        }

        if ($route->redirect_to !== null) {
            /** @var \Wasabi\Core\Model\Entity\Route $redirectRoute */
            $redirectRoute = $Routes->get($route->redirect_to);

            $redirectUrl = $redirectRoute->url;
            $statusCode = 301;
            if ($pageNumber !== false && $pageNumber > 1) {
                $redirectUrl .= '/' . self::PAGE_PART . '/' . $pageNumber;
            }
            if ($route->status_code !== null) {
                $statusCode = (int)$route->status_code;
            }

            $this->_redirect($redirectUrl, $statusCode);
        }

        // Dispatch Wasabi.Routes.parse event to all plugin listeners to get params.
        $routesParseEvent = new Event('Wasabi.Routes.parse', $url, [
            'route' => $route,
            'pageNumber' => $pageNumber
        ]);

        EventManager::instance()->dispatch($routesParseEvent);

        if (!$routesParseEvent->isStopped() || empty($routesParseEvent->result['params'])) {
            return false;
        }

        $params = $routesParseEvent->result['params'];

        return $params;
    }