Magento 2 Front controller reached 100 router match iterations

Today we talk about most common error when you trying to add dynamic route in your module. There are three set need to be setModuleName, setControllerName and
setActionName. The problem is cause when there is no matching with your setModuleName, setControllerName and setActionName. May be is causing by spell mistake and any lower uppercase.

But the biggest confusion in this when you set setModuleName. You think of your module name but this is fronName that you are set in your frontend/routes.xml

    app/code/QaisarSatti/HelloWorld/etc/frontend/routes.xml
<?xml version="1.0"?>
<!--/**
* Simple Hello World Module
*
* @category QaisarSatti
* @package QaisarSatti_HelloWorld
* @author Muhammad Qaisar Satti
* @Email qaisarssatti@gmail.com
*
*/ -->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="standard">
<route id="helloworld" frontName="helloworld">
<module name="QaisarSatti_HelloWorld" />
</route>
</router>
</config>

Now your setting will be in your router.php by following module

$request->setModuleName('helloworld')->setControllerName('index')->setActionName('index')

Qaisar Satti

Hi, I'm Qaisar Satti! I've been a developer for over 20 years, and now I love sharing what I've learned through tutorials and guides. Whether you're working with Magento, PrestaShop, or WooCommerce, my goal is to make your development journey a bit easier and more fun. When I'm not coding or writing, you can find me exploring new tech trends and hanging out with the amazing developer community. Thanks for stopping by, and happy coding!

Leave a Reply