5

I am trying to rewrite url in routes.php with magento 2.2.2 version. url key is dynamically set from configuration. got this error :: Front controller reached 100 router match iterations

$urlKey = trim($this->scopeConfig->getValue('section/group/url_key', $storeScope), '/');
 $identifier = trim($request->getPathInfo(), '/');
 if ($identifier == $urlKey) {
 $request->setModuleName('search')->setControllerName('index')->setActionName('index');
 $request->setAlias(\Magento\Framework\Url::REWRITE_REQUEST_PATH_ALIAS, $identifier);
 } else {
 return false;
 }
 return $this->actionFactory->create(
 'Magento\Framework\App\Action\Forward',
 ['request' => $request]
 );
asked Jan 3, 2018 at 7:13
1
  • yes @ManthanDave i have overrides Router.php Commented Jan 3, 2018 at 7:25

1 Answer 1

3

This issue come because Mach condition check infinite the solution is

public function match(\Magento\Framework\App\RequestInterface $request)
 {
 if($request->getModuleName() == 'search'){
 return;
 }
 }
answered Jan 3, 2018 at 13:50

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.