I am trying to forward controller to noroute page with below code but got error.

Front controller reached 100 router match iterations

protected $resultForwardFactory;

public function __construct(
    \Magento\Framework\App\Action\Context $context,
    \Magento\Framework\Controller\Result\ForwardFactory $resultForwardFactory,
    \Test\Test\Helper\Data $test
) {
    $this->resultForwardFactory = $resultForwardFactory;
    $this->test = $test;        
public function execute()
    if (!$this->test->isModuleEnabled()) {
        return $this->resultForwardFactory->create()->forward('noroute'); 
 Debug the dispatch function in class Magento\Framework\App\FrontController and log the error which may gives way to find exact error. 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.