Custom router gives me “Front controller reached 100 router match iterations” when matches 404 Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?What is the cause of “Front controller reached 100 router match iterations” error?How can i rewrite TierPrice Block in Magento2404 Page - Front controller reached 100 router match iterationsMagento 2:ERROR: Front controller reached 100 router match iterationsMagento 2 Admin Front controller reached 100 router match iterationsMagento 2: toolbar url problems in custom module with custom routermagento 2 - custom router throws Front controller reached 100 router match iterations errorHow to solve Front controller reached 100 router match iterations in magento2Magento 2 Front controller reached 100 router match iterations issueMagento 2 : Front controller reached 100 router match iterations

Marquee sign letters

Bright yellow or light yellow?

Like totally amazing interchangeable sister outfit accessory swapping or whatever

Why is arima in R one time step off?

Getting AggregateResult variables from Execute Anonymous Window

How long can a nation maintain a technological edge over the rest of the world?

Will temporary Dex penalties prevent you from getting the benefits of the "Two Weapon Fighting" feat if your Dex score falls below the prerequisite?

Is it appropriate to mention a relatable company blog post when you're asked about the company?

Will I be more secure with my own router behind my ISP's router?

All ASCII characters with a given bit count

Processing ADC conversion result: DMA vs Processor Registers

Where/What are Arya's scars from?

How can I wire a 9-position switch so that each position turns on one more LED than the one before?

"Working on a knee"

TV series episode where humans nuke aliens before decrypting their message that states they come in peace

What were wait-states, and why was it only an issue for PCs?

Suing a Police Officer Instead of the Police Department

What is the ongoing value of the Kanban board to the developers as opposed to management

France's Public Holidays' Puzzle

When does Bran Stark remember Jamie pushing him?

Does a Draconic Bloodline sorcerer's doubled proficiency bonus for Charisma checks against dragons apply to all dragon types or only the chosen one?

Where can I find how to tex symbols for different fonts?

How was Lagrange appointed professor of mathematics so early?

Why do people think Winterfell crypts is the safest place for women, children & old people?



Custom router gives me “Front controller reached 100 router match iterations” when matches 404



Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?What is the cause of “Front controller reached 100 router match iterations” error?How can i rewrite TierPrice Block in Magento2404 Page - Front controller reached 100 router match iterationsMagento 2:ERROR: Front controller reached 100 router match iterationsMagento 2 Admin Front controller reached 100 router match iterationsMagento 2: toolbar url problems in custom module with custom routermagento 2 - custom router throws Front controller reached 100 router match iterations errorHow to solve Front controller reached 100 router match iterations in magento2Magento 2 Front controller reached 100 router match iterations issueMagento 2 : Front controller reached 100 router match iterations



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








3















I created a custom router



this is my di.xml



<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MagentoFrameworkAppRouterList">
<arguments>
<argument name="routerList" xsi:type="array">
<item name="default" xsi:type="array">
<item name="class" xsi:type="string">VendorCustomControllerRouter</item>
<item name="disable" xsi:type="boolean">false</item>
<item name="sortOrder" xsi:type="string">40</item>
</item>
</argument>
</arguments>
</type>
</config>


This is the block match function:



public function match(MagentoFrameworkAppRequestInterface $request) 
$identifier = trim($request->getPathInfo(), '/');

if(strpos($identifier, 'search') !== false)

$request->setModuleName('catalogsearch')->setControllerName('result')->setActionName('index');
else
//There is no match
return;


/*
* We have match and now we will forward action
*/
return $this->actionFactory->create(
'MagentoFrameworkAppActionForward', ['request' => $request]
);



Everything is fine till I got an error "Front controller reached 100 router match iterations" everytime I go to a 404 page.










share|improve this question






















  • what is the url of your 404 page ?

    – Yash Shah
    yesterday











  • cms/noroute/index this is working, but when I get to example.com/any-inexistent-path, the error takes place

    – xdev
    yesterday


















3















I created a custom router



this is my di.xml



<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MagentoFrameworkAppRouterList">
<arguments>
<argument name="routerList" xsi:type="array">
<item name="default" xsi:type="array">
<item name="class" xsi:type="string">VendorCustomControllerRouter</item>
<item name="disable" xsi:type="boolean">false</item>
<item name="sortOrder" xsi:type="string">40</item>
</item>
</argument>
</arguments>
</type>
</config>


This is the block match function:



public function match(MagentoFrameworkAppRequestInterface $request) 
$identifier = trim($request->getPathInfo(), '/');

if(strpos($identifier, 'search') !== false)

$request->setModuleName('catalogsearch')->setControllerName('result')->setActionName('index');
else
//There is no match
return;


/*
* We have match and now we will forward action
*/
return $this->actionFactory->create(
'MagentoFrameworkAppActionForward', ['request' => $request]
);



Everything is fine till I got an error "Front controller reached 100 router match iterations" everytime I go to a 404 page.










share|improve this question






















  • what is the url of your 404 page ?

    – Yash Shah
    yesterday











  • cms/noroute/index this is working, but when I get to example.com/any-inexistent-path, the error takes place

    – xdev
    yesterday














3












3








3








I created a custom router



this is my di.xml



<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MagentoFrameworkAppRouterList">
<arguments>
<argument name="routerList" xsi:type="array">
<item name="default" xsi:type="array">
<item name="class" xsi:type="string">VendorCustomControllerRouter</item>
<item name="disable" xsi:type="boolean">false</item>
<item name="sortOrder" xsi:type="string">40</item>
</item>
</argument>
</arguments>
</type>
</config>


This is the block match function:



public function match(MagentoFrameworkAppRequestInterface $request) 
$identifier = trim($request->getPathInfo(), '/');

if(strpos($identifier, 'search') !== false)

$request->setModuleName('catalogsearch')->setControllerName('result')->setActionName('index');
else
//There is no match
return;


/*
* We have match and now we will forward action
*/
return $this->actionFactory->create(
'MagentoFrameworkAppActionForward', ['request' => $request]
);



Everything is fine till I got an error "Front controller reached 100 router match iterations" everytime I go to a 404 page.










share|improve this question














I created a custom router



this is my di.xml



<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MagentoFrameworkAppRouterList">
<arguments>
<argument name="routerList" xsi:type="array">
<item name="default" xsi:type="array">
<item name="class" xsi:type="string">VendorCustomControllerRouter</item>
<item name="disable" xsi:type="boolean">false</item>
<item name="sortOrder" xsi:type="string">40</item>
</item>
</argument>
</arguments>
</type>
</config>


This is the block match function:



public function match(MagentoFrameworkAppRequestInterface $request) 
$identifier = trim($request->getPathInfo(), '/');

if(strpos($identifier, 'search') !== false)

$request->setModuleName('catalogsearch')->setControllerName('result')->setActionName('index');
else
//There is no match
return;


/*
* We have match and now we will forward action
*/
return $this->actionFactory->create(
'MagentoFrameworkAppActionForward', ['request' => $request]
);



Everything is fine till I got an error "Front controller reached 100 router match iterations" everytime I go to a 404 page.







magento2 router






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 2 days ago









xdevxdev

637




637












  • what is the url of your 404 page ?

    – Yash Shah
    yesterday











  • cms/noroute/index this is working, but when I get to example.com/any-inexistent-path, the error takes place

    – xdev
    yesterday


















  • what is the url of your 404 page ?

    – Yash Shah
    yesterday











  • cms/noroute/index this is working, but when I get to example.com/any-inexistent-path, the error takes place

    – xdev
    yesterday

















what is the url of your 404 page ?

– Yash Shah
yesterday





what is the url of your 404 page ?

– Yash Shah
yesterday













cms/noroute/index this is working, but when I get to example.com/any-inexistent-path, the error takes place

– xdev
yesterday






cms/noroute/index this is working, but when I get to example.com/any-inexistent-path, the error takes place

– xdev
yesterday











2 Answers
2






active

oldest

votes


















0














try compile and flush cache



bin/magento setup:di:compile
bin/magento cache:flush





share|improve this answer























  • not working, already done

    – xdev
    2 days ago











  • Try dump data in your condition "strpos($identifier, 'search')" I think it has problem in here

    – the light
    2 days ago











  • you mean to print the identifier value?

    – xdev
    2 days ago


















0














Set return null in your else condition :



public function match(MagentoFrameworkAppRequestInterface $request) 
$identifier = trim($request->getPathInfo(), '/');

if(strpos($identifier, 'search') !== false)

$request->setModuleName('catalogsearch')->setControllerName('result')->setActionName('index');
else
//There is no match
return null;


/*
* We have match and now we will forward action
*/
return $this->actionFactory->create(
'MagentoFrameworkAppActionForward', ['request' => $request]
);






share|improve this answer























  • not working... still gives me that error

    – xdev
    2 days ago












Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f270866%2fcustom-router-gives-me-front-controller-reached-100-router-match-iterations-wh%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














try compile and flush cache



bin/magento setup:di:compile
bin/magento cache:flush





share|improve this answer























  • not working, already done

    – xdev
    2 days ago











  • Try dump data in your condition "strpos($identifier, 'search')" I think it has problem in here

    – the light
    2 days ago











  • you mean to print the identifier value?

    – xdev
    2 days ago















0














try compile and flush cache



bin/magento setup:di:compile
bin/magento cache:flush





share|improve this answer























  • not working, already done

    – xdev
    2 days ago











  • Try dump data in your condition "strpos($identifier, 'search')" I think it has problem in here

    – the light
    2 days ago











  • you mean to print the identifier value?

    – xdev
    2 days ago













0












0








0







try compile and flush cache



bin/magento setup:di:compile
bin/magento cache:flush





share|improve this answer













try compile and flush cache



bin/magento setup:di:compile
bin/magento cache:flush






share|improve this answer












share|improve this answer



share|improve this answer










answered 2 days ago









the lightthe light

695




695












  • not working, already done

    – xdev
    2 days ago











  • Try dump data in your condition "strpos($identifier, 'search')" I think it has problem in here

    – the light
    2 days ago











  • you mean to print the identifier value?

    – xdev
    2 days ago

















  • not working, already done

    – xdev
    2 days ago











  • Try dump data in your condition "strpos($identifier, 'search')" I think it has problem in here

    – the light
    2 days ago











  • you mean to print the identifier value?

    – xdev
    2 days ago
















not working, already done

– xdev
2 days ago





not working, already done

– xdev
2 days ago













Try dump data in your condition "strpos($identifier, 'search')" I think it has problem in here

– the light
2 days ago





Try dump data in your condition "strpos($identifier, 'search')" I think it has problem in here

– the light
2 days ago













you mean to print the identifier value?

– xdev
2 days ago





you mean to print the identifier value?

– xdev
2 days ago













0














Set return null in your else condition :



public function match(MagentoFrameworkAppRequestInterface $request) 
$identifier = trim($request->getPathInfo(), '/');

if(strpos($identifier, 'search') !== false)

$request->setModuleName('catalogsearch')->setControllerName('result')->setActionName('index');
else
//There is no match
return null;


/*
* We have match and now we will forward action
*/
return $this->actionFactory->create(
'MagentoFrameworkAppActionForward', ['request' => $request]
);






share|improve this answer























  • not working... still gives me that error

    – xdev
    2 days ago
















0














Set return null in your else condition :



public function match(MagentoFrameworkAppRequestInterface $request) 
$identifier = trim($request->getPathInfo(), '/');

if(strpos($identifier, 'search') !== false)

$request->setModuleName('catalogsearch')->setControllerName('result')->setActionName('index');
else
//There is no match
return null;


/*
* We have match and now we will forward action
*/
return $this->actionFactory->create(
'MagentoFrameworkAppActionForward', ['request' => $request]
);






share|improve this answer























  • not working... still gives me that error

    – xdev
    2 days ago














0












0








0







Set return null in your else condition :



public function match(MagentoFrameworkAppRequestInterface $request) 
$identifier = trim($request->getPathInfo(), '/');

if(strpos($identifier, 'search') !== false)

$request->setModuleName('catalogsearch')->setControllerName('result')->setActionName('index');
else
//There is no match
return null;


/*
* We have match and now we will forward action
*/
return $this->actionFactory->create(
'MagentoFrameworkAppActionForward', ['request' => $request]
);






share|improve this answer













Set return null in your else condition :



public function match(MagentoFrameworkAppRequestInterface $request) 
$identifier = trim($request->getPathInfo(), '/');

if(strpos($identifier, 'search') !== false)

$request->setModuleName('catalogsearch')->setControllerName('result')->setActionName('index');
else
//There is no match
return null;


/*
* We have match and now we will forward action
*/
return $this->actionFactory->create(
'MagentoFrameworkAppActionForward', ['request' => $request]
);







share|improve this answer












share|improve this answer



share|improve this answer










answered 2 days ago









Rohan HapaniRohan Hapani

7,11631865




7,11631865












  • not working... still gives me that error

    – xdev
    2 days ago


















  • not working... still gives me that error

    – xdev
    2 days ago

















not working... still gives me that error

– xdev
2 days ago






not working... still gives me that error

– xdev
2 days ago


















draft saved

draft discarded
















































Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f270866%2fcustom-router-gives-me-front-controller-reached-100-router-match-iterations-wh%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?