actionFactory = $actionFactory; $this->_request = $request; $this->pageRepository = $pageRepository; $this->_response = $response; $this->googleMapsStoreHelper = $helper; } public function match(\Magento\Framework\App\RequestInterface $request) { $route = $this->googleMapsStoreHelper->getGMapSeoIdentifier(); $suffix = $this->googleMapsStoreHelper->getGMapSeoSuffix(); $identifier = trim($request->getPathInfo(), '/'); $identifie = $route.$suffix; if (strcmp($identifie, $identifier)==0) { $request->setModuleName('storelocator')->setControllerName('Index')->setActionName('Index'); $request->setAlias(\Magento\Framework\Url::REWRITE_REQUEST_PATH_ALIAS, $identifier); } else { return; } return $this->actionFactory->create( 'Magento\Framework\App\Action\Forward', ['request' => $request] ); } }