{"id":14808,"date":"2017-12-07T15:33:36","date_gmt":"2017-12-07T12:33:36","guid":{"rendered":"https:\/\/belvg.com\/blog\/?p=14808"},"modified":"2025-02-11T10:43:15","modified_gmt":"2025-02-11T08:43:15","slug":"which-routers-exist-in-a-native-magento-1-and-magento-2","status":"publish","type":"post","link":"https:\/\/belvg.com\/blog\/which-routers-exist-in-a-native-magento-1-and-magento-2.html","title":{"rendered":"Which Routers Exist in a Native Magento 1 and Magento 2"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">Routing in Magento is one of the most essential parts every developer should be aware of. Processing URL request and router classes responsible for matching and processing that request influence the application flow. Let&#8217;s get into the nuts and bolts together.<!--more--> <\/span><\/p>\n<h2><strong>Magento 1<\/strong><\/h2>\n<p><strong>Admin Router &#8594; Standard Router &#8594; Custom router &#8594; Default Router<\/strong><\/p>\n<p><strong>Admin router<\/strong><br \/>\n<span style=\"font-weight: 400;\">It&#8217;s used for backend requests <\/span><br \/>\n<span style=\"font-weight: 400;\">File: app\/code\/core\/Mage\/Core\/Controller\/Varien\/Router\/Admin.php<\/span><br \/>\n<span style=\"font-weight: 400;\">Class: Mage_Core_Controller_Varien_Router_Admin<\/span><\/p>\n<p><strong>Standard router<\/strong><br \/>\n<span style=\"font-weight: 400;\">It&#8217;s used for frontend requests<\/span><br \/>\n<span style=\"font-weight: 400;\">File: app\/code\/core\/Mage\/Core\/Controller\/Varien\/Router\/Standard.php<\/span><br \/>\n<span style=\"font-weight: 400;\">Class: Mage_Core_Controller_Varien_Router_Standard<\/span><\/p>\n<p><strong>Custom router<\/strong><br \/>\n<span style=\"font-weight: 400;\">CMS Pages for example<\/span><\/p>\n<p><strong>Default router<\/strong><br \/>\n<span style=\"font-weight: 400;\">Mage_Core_Controller_Varien_Router_Default<\/span><\/p>\n<p><span style=\"font-weight: 400;\">It&#8217;s used when other routers don&#8217;t match. The value is specified in &#8220;Default No-route URL&#8221; field at &#8220;System\/Configuration\/General\/Web\/Default Pages&#8221;. The value &#8220;cms\/index\/noRoute&#8221; is used by default and redirects to 404 page. <\/span><br \/>\n<span style=\"font-weight: 400;\">File: app\/code\/core\/Mage\/Core\/Controller\/Varien\/Router\/Default.php<\/span><br \/>\n<span style=\"font-weight: 400;\">Class: Mage_Core_Controller_Varien_Router_Default<\/span><\/p>\n<h2><b>Magento 2<\/b><\/h2>\n<p><strong>Base Router &#8594; CMS Router &#8594; UrlRewrite Router &#8594; Custom router &#8594; Default Router<\/strong><\/p>\n<p><strong>Base Router<\/strong><br \/>\n<span style=\"font-weight: 400;\">File: lib\/internal\/Magento\/Framework\/App\/Router\/Base.php<\/span><br \/>\n<span style=\"font-weight: 400;\">Match method will parseRequest and matchAction, and in the second method it will set module front name, controller path name, action name, controller module and route name. At base router standard Magento URL (front_name\/action_path\/action\/param_1\/etc_params\/) is matched.<\/span><\/p>\n<p><strong>CMS Router<\/strong><br \/>\n<span style=\"font-weight: 400;\">File: app\/code\/Magento\/Cms\/Controller\/Router.php<\/span><br \/>\n<span style=\"font-weight: 400;\">It&#8217;s used for cms pages<\/span><\/p>\n<p><strong>UrlRewrite Router<\/strong><br \/>\n<span style=\"font-weight: 400;\">File: app\/code\/Magento\/UrlRewrite\/Controller\/Router.php<\/span><br \/>\n<span style=\"font-weight: 400;\">It searches for UrlRewrite in the database <\/span><\/p>\n<p><strong>Custom Router<\/strong><br \/>\n<span style=\"font-weight: 400;\">The routers information for the modules is described in the routerList parameter of Magento\\Framework\\App\\RouterList type in your di.xml. Each area has its own set of the routers. The Magento\\Framework\\App\\RouterList model is injected into FrontController.<\/span><\/p>\n<p><strong>Default Router<\/strong><br \/>\n<span style=\"font-weight: 400;\">File: lib\/internal\/Magento\/Framework\/App\/Router\/DefaultRouter.php<\/span><br \/>\n<span style=\"font-weight: 400;\">It&#8217;s used when other routers don&#8217;t match. Page 404 will be displayed.<\/span><\/p>\n<h2><strong>What occurs in router classes<\/strong><\/h2>\n<h2><strong>Magento 1<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">Let&#8217;s take the main page as an example and consider how it works. It uses the class Mage_Core_Controller_Varien_Router_Standard. The class contains the method &#160;match() which obtains the object $request of the type Zend_Controller_Request_Http. Let&#8217;s have a closer look at what occurs then:<\/span><\/p>\n<p>1. Define the module name<\/p>\n<p><span style=\"font-weight: 400;\">We try to extract the module name from the object <\/span><span style=\"font-weight: 400;\">$request.<\/span><span style=\"font-weight: 400;\"> If there&#8217;s no name, we try to get the value using $request-&gt;getPathInfo(). In case when the module name is not found (from admin&#8217;s side), the value is $module = &#8216;admin&#8217;; otherwise, the function stops executing. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">For the main page: $module = &#8216;cms&#8217;.<\/span><\/p>\n<p>2. After the module name is defined, we search router args<\/p>\n<p><span style=\"font-weight: 400;\">For the main page: $modules = [&#8216;0&#8217; =&gt; &#8216;Mage_cms&#8217;]<\/span><\/p>\n<p>3. Go through modules to find appropriate controller.<\/p>\n<p><span style=\"font-weight: 400;\">Here we get the instance of the class found. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">The example of the main page: $controllerClassName = &#8216;Mage_Cms_IndexController&#8217;<\/span><\/p>\n<p>4. If we don&#8217;t find any suitable function, the function stops executing.<\/p>\n<p><span style=\"font-weight: 400;\">5. After the module name, controller and action are defined successfully, for the object $request we specify the value of module name (ModuleName), controller (ControllerName), action (ActionName) and (ControllerModule).<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The example of the main page:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">$realModule = &#8216;Mage_cms&#8217;<\/span><br \/>\n<span style=\"font-weight: 400;\">$controller = &#8216;index&#8217;<\/span><br \/>\n<span style=\"font-weight: 400;\">$controllerClassName = &#8216;Mage_Cms_IndexController&#8217;<\/span><\/p>\n<p>6. Then on the object $request we put dispatched = true, and controller dispatches the action method.<\/p>\n<h2><strong>Magento 2<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">As an example of the main page, in Magento 2<\/span><\/p>\n<pre class=\"lang:default decode:true \">Magento\\Framework\\App\\FrontController::dispatch(RequestInterface $request)<\/pre>\n<p>is responsible for match application action by request.<\/p>\n<p><span style=\"font-weight: 400;\">The method dispatch iterates through routersList which contains the classes described above and tries to find matches. <\/span><\/p>\n<pre class=\"lang:default decode:true \">$actionInstance = $router-&gt;match($request);<\/pre>\n<p><span style=\"font-weight: 400;\">If there are matches, as is the case with Magento 1 there will be dispatched = true and dispatch request.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">What occurs in match? Let&#8217;s consider \\vendor\\magento\\framework\\App\\Router\\Base.php:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">1. The method &#8220;match&#8221; parses the request and calls the method matchAction().<\/span><\/p>\n<p><span style=\"font-weight: 400;\">2. When getting in matchAction, you can see the part of the code known due to Magento 1 where we also get the list of modules by route front name.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">For main page: $modules = [&#8216;0&#8217; =&gt; &#8216;Magento_Cms&#8217;].<\/span><\/p>\n<p><span style=\"font-weight: 400;\">3. Then go through modules to find appropriate controller. We define $actionClassName and get the instance of the class found. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">The example of the main page: $actionClassName &#160;= &#8216;Magento\\Cms\\Controller\\Index\\Index&#8217;.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">4. Here we follow the way if $actionInstance is empty.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">5. After the module name, controller and action are defined successfully, for the object $request we specify the value of module name (ModuleName), controller (ControllerName), action (ActionName), (ControllerModule) and (setRouteName).<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The example of main page:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">$moduleFrontName = &#8216;cms&#8217;<\/span><br \/>\n<span style=\"font-weight: 400;\">$actionPath = &#8216;index&#8217;<\/span><br \/>\n<span style=\"font-weight: 400;\">$action = &#8216;index&#8217;<\/span><br \/>\n<span style=\"font-weight: 400;\">$currentModuleName = &#8216;Magento_Cms&#8217;<\/span><br \/>\n<span style=\"font-weight: 400;\">$routeName = &#8216;cms&#8217;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">6. Return $actionInstance and get back in Magento\\Framework\\App\\FrontController::dispatch() where we put dispatched = true and dispatch request.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"Developer Certification Exam","protected":false},"author":58,"featured_media":14813,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"image","meta":{"_acf_changed":false,"footnotes":""},"categories":[35,14,471],"tags":[],"class_list":["post-14808","post","type-post","status-publish","format-image","has-post-thumbnail","hentry","category-certification","category-magento","category-magento-developer","post_format-image"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.4 - aioseo.com -->\n\t<meta name=\"description\" content=\"Routing in Magento is one of the most essential parts every developer should be aware of. Processing URL request and router classes responsible for matching and processing that request influence the application flow. Let\u2019s get into the nuts and bolts together.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Aleksander Kutseika\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/belvg.com\/blog\/which-routers-exist-in-a-native-magento-1-and-magento-2.html\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.4\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/which-routers-exist-in-a-native-magento-1-and-magento-2.html#article\",\"name\":\"Which Routers Exist in a Native Magento 1 and Magento 2 | BelVG Blog\",\"headline\":\"Which Routers Exist in a Native Magento 1 and Magento 2\",\"author\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/aleksander-kutseika#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/12\\\/Which-Routers-Exist-in-a-Native-Magento-1-and-Magento-2.jpg\",\"width\":770,\"height\":433,\"caption\":\"Which Routers Exist in a Native Magento 1 and Magento 2\"},\"datePublished\":\"2017-12-07T15:33:36+02:00\",\"dateModified\":\"2025-02-11T10:43:15+02:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/which-routers-exist-in-a-native-magento-1-and-magento-2.html#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/which-routers-exist-in-a-native-magento-1-and-magento-2.html#webpage\"},\"articleSection\":\"Certification, Magento, Magento Developer, Image\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/which-routers-exist-in-a-native-magento-1-and-magento-2.html#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento#listItem\",\"name\":\"Magento\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento#listItem\",\"position\":2,\"name\":\"Magento\",\"item\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/which-routers-exist-in-a-native-magento-1-and-magento-2.html#listItem\",\"name\":\"Which Routers Exist in a Native Magento 1 and Magento 2\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/which-routers-exist-in-a-native-magento-1-and-magento-2.html#listItem\",\"position\":3,\"name\":\"Which Routers Exist in a Native Magento 1 and Magento 2\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento#listItem\",\"name\":\"Magento\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\",\"name\":\"BelVG Blog\",\"description\":\"Magento and Prestashop articles\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/aleksander-kutseika#author\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/aleksander-kutseika\",\"name\":\"Aleksander Kutseika\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/which-routers-exist-in-a-native-magento-1-and-magento-2.html#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/20dcba617ca05952a14d36e3f30fc6a632094549decebf7a03ba790095042cd3?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Aleksander Kutseika\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/which-routers-exist-in-a-native-magento-1-and-magento-2.html#webpage\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/which-routers-exist-in-a-native-magento-1-and-magento-2.html\",\"name\":\"Which Routers Exist in a Native Magento 1 and Magento 2 | BelVG Blog\",\"description\":\"Routing in Magento is one of the most essential parts every developer should be aware of. Processing URL request and router classes responsible for matching and processing that request influence the application flow. Let\\u2019s get into the nuts and bolts together.\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/which-routers-exist-in-a-native-magento-1-and-magento-2.html#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/aleksander-kutseika#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/aleksander-kutseika#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/12\\\/Which-Routers-Exist-in-a-Native-Magento-1-and-Magento-2.jpg\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/which-routers-exist-in-a-native-magento-1-and-magento-2.html\\\/#mainImage\",\"width\":770,\"height\":433,\"caption\":\"Which Routers Exist in a Native Magento 1 and Magento 2\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/which-routers-exist-in-a-native-magento-1-and-magento-2.html#mainImage\"},\"datePublished\":\"2017-12-07T15:33:36+02:00\",\"dateModified\":\"2025-02-11T10:43:15+02:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\",\"name\":\"BelVG Blog\",\"description\":\"Magento and Prestashop articles\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Which Routers Exist in a Native Magento 1 and Magento 2 | BelVG Blog","description":"Routing in Magento is one of the most essential parts every developer should be aware of. Processing URL request and router classes responsible for matching and processing that request influence the application flow. Let\u2019s get into the nuts and bolts together.","canonical_url":"https:\/\/belvg.com\/blog\/which-routers-exist-in-a-native-magento-1-and-magento-2.html","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/belvg.com\/blog\/which-routers-exist-in-a-native-magento-1-and-magento-2.html#article","name":"Which Routers Exist in a Native Magento 1 and Magento 2 | BelVG Blog","headline":"Which Routers Exist in a Native Magento 1 and Magento 2","author":{"@id":"https:\/\/belvg.com\/blog\/author\/aleksander-kutseika#author"},"publisher":{"@id":"https:\/\/belvg.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2017\/12\/Which-Routers-Exist-in-a-Native-Magento-1-and-Magento-2.jpg","width":770,"height":433,"caption":"Which Routers Exist in a Native Magento 1 and Magento 2"},"datePublished":"2017-12-07T15:33:36+02:00","dateModified":"2025-02-11T10:43:15+02:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/belvg.com\/blog\/which-routers-exist-in-a-native-magento-1-and-magento-2.html#webpage"},"isPartOf":{"@id":"https:\/\/belvg.com\/blog\/which-routers-exist-in-a-native-magento-1-and-magento-2.html#webpage"},"articleSection":"Certification, Magento, Magento Developer, Image"},{"@type":"BreadcrumbList","@id":"https:\/\/belvg.com\/blog\/which-routers-exist-in-a-native-magento-1-and-magento-2.html#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/#listItem","position":1,"name":"Home","item":"https:\/\/belvg.com\/blog\/","nextItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento#listItem","name":"Magento"}},{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento#listItem","position":2,"name":"Magento","item":"https:\/\/belvg.com\/blog\/category\/magento","nextItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/which-routers-exist-in-a-native-magento-1-and-magento-2.html#listItem","name":"Which Routers Exist in a Native Magento 1 and Magento 2"},"previousItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/which-routers-exist-in-a-native-magento-1-and-magento-2.html#listItem","position":3,"name":"Which Routers Exist in a Native Magento 1 and Magento 2","previousItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento#listItem","name":"Magento"}}]},{"@type":"Organization","@id":"https:\/\/belvg.com\/blog\/#organization","name":"BelVG Blog","description":"Magento and Prestashop articles","url":"https:\/\/belvg.com\/blog\/"},{"@type":"Person","@id":"https:\/\/belvg.com\/blog\/author\/aleksander-kutseika#author","url":"https:\/\/belvg.com\/blog\/author\/aleksander-kutseika","name":"Aleksander Kutseika","image":{"@type":"ImageObject","@id":"https:\/\/belvg.com\/blog\/which-routers-exist-in-a-native-magento-1-and-magento-2.html#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/20dcba617ca05952a14d36e3f30fc6a632094549decebf7a03ba790095042cd3?s=96&d=mm&r=g","width":96,"height":96,"caption":"Aleksander Kutseika"}},{"@type":"WebPage","@id":"https:\/\/belvg.com\/blog\/which-routers-exist-in-a-native-magento-1-and-magento-2.html#webpage","url":"https:\/\/belvg.com\/blog\/which-routers-exist-in-a-native-magento-1-and-magento-2.html","name":"Which Routers Exist in a Native Magento 1 and Magento 2 | BelVG Blog","description":"Routing in Magento is one of the most essential parts every developer should be aware of. Processing URL request and router classes responsible for matching and processing that request influence the application flow. Let\u2019s get into the nuts and bolts together.","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/belvg.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/belvg.com\/blog\/which-routers-exist-in-a-native-magento-1-and-magento-2.html#breadcrumblist"},"author":{"@id":"https:\/\/belvg.com\/blog\/author\/aleksander-kutseika#author"},"creator":{"@id":"https:\/\/belvg.com\/blog\/author\/aleksander-kutseika#author"},"image":{"@type":"ImageObject","url":"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2017\/12\/Which-Routers-Exist-in-a-Native-Magento-1-and-Magento-2.jpg","@id":"https:\/\/belvg.com\/blog\/which-routers-exist-in-a-native-magento-1-and-magento-2.html\/#mainImage","width":770,"height":433,"caption":"Which Routers Exist in a Native Magento 1 and Magento 2"},"primaryImageOfPage":{"@id":"https:\/\/belvg.com\/blog\/which-routers-exist-in-a-native-magento-1-and-magento-2.html#mainImage"},"datePublished":"2017-12-07T15:33:36+02:00","dateModified":"2025-02-11T10:43:15+02:00"},{"@type":"WebSite","@id":"https:\/\/belvg.com\/blog\/#website","url":"https:\/\/belvg.com\/blog\/","name":"BelVG Blog","description":"Magento and Prestashop articles","inLanguage":"en-US","publisher":{"@id":"https:\/\/belvg.com\/blog\/#organization"}}]}},"aioseo_meta_data":{"post_id":"14808","title":"Which Routers Exist in a Native Magento 1 and Magento 2 | #site_title","description":"Routing in Magento is one of the most essential parts every developer should be aware of. Processing URL request and router classes responsible for matching and processing that request influence the application flow. Let\u2019s get into the nuts and bolts together.","keywords":null,"keyphrases":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_custom_url":null,"og_image_custom_fields":null,"og_image_url":null,"og_image_width":null,"og_image_height":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_image_url":null,"twitter_title":null,"twitter_description":null,"schema_type":"default","schema_type_options":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null,"created":"2026-11-03 18:37:13","updated":"2026-11-03 18:37:13"},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/belvg.com\/blog\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/belvg.com\/blog\/category\/magento\" title=\"Magento\">Magento<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tWhich Routers Exist in a Native Magento 1 and Magento 2\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/belvg.com\/blog\/"},{"label":"Magento","link":"https:\/\/belvg.com\/blog\/category\/magento"},{"label":"Which Routers Exist in a Native Magento 1 and Magento 2","link":"https:\/\/belvg.com\/blog\/which-routers-exist-in-a-native-magento-1-and-magento-2.html"}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/14808","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/users\/58"}],"replies":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/comments?post=14808"}],"version-history":[{"count":0,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/14808\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/media\/14813"}],"wp:attachment":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/media?parent=14808"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/categories?post=14808"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/tags?post=14808"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}