code: private function getAliasCandidates(string $pathInfo): array
      {
          $pos = strpos($pathInfo, '/');
  
          if (false === $pos) {
              return [$pathInfo];
          }
  
          /** @var Config $config */
          $config = $this->framework->getAdapter(Config::class);
  
          if (!$config->get('folderUrl')) {
              return [substr($pathInfo, 0, $pos)];
          }
  
          $candidates = [$pathInfo];
  
          while ('/' !== $pathInfo && false !== strpos($pathInfo, '/')) {
              $pathInfo = \dirname($pathInfo);
              $candidates[] = $pathInfo;
          }
  
          return $candidates;
      }
docs: Compiles all possible aliases by applying dirname() to the request (e.g. news/archive/item, news/archive, news).
  
  @return string[]