As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [routing]

Denotes questions related to the routing mechanism of Magento

Filter by
Sorted by
Tagged with
1 vote
1 answer
1k views

Magento doesn't support camelCase in URL/route?

If you are declaring your router in etc/adminhtml/routes.xml with similar way <?xml version="1.0" encoding="UTF-8"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
2 votes
1 answer
2k views

Magento 2: How to define scope in di.xml & Router.php

I'm using Magento 2 CE Version 2.1.0. app\code\Custom\Module\etc\frontend\di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
1 vote
1 answer
2k views

Magento 2 Front controller reached 100 router match iterations issue

I am not able to access back-end and front end working fine. I have disabled and removed custom modules, but still it's persist. Help me! My magento version 2.1.6 When I print anything inside the ...
0 votes
2 answers
256 views

Custom controller action to specific path in magento 1.9

how to redirect the custom controller path to specific store name http://testurl.com/testmodule/index/testview/id/123/ to http://testurl.com/testname thanks
0 votes
1 answer
330 views

Magento 2: Controller Invalid return type for Account Controller

Just wrote the following controller: namespace MySite\MyCustomModule\Controller\Dashboard; use Magento\Customer\Controller\AccountInterface; use Magento\Framework\App\Action\HttpGetActionInterface as ...
0 votes
1 answer
35 views

Route to Existing Layout

I am working on a custom page module and want to make a custom route however I would like to use the catalog_category_view.xml layout, instead of the [module_name]_index_index.xml needed for my route ...
1 vote
1 answer
71 views

Front controller reached 100 router match iterations and routing issue

Every day we get 100 if not 1000's of main.CRITICAL: Front controller reached 100 router match iterations error in our log. var/report is full of logs. Yesterday we had 280 logs in /report. in var/...
0 votes
4 answers
179 views

Why is my post controller returning a 404?

I've created and enabled a module at app/code/Post/Test: app/code/Post/Test/registration.php: <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\...
0 votes
1 answer
166 views

Homepage routing problem with $this->pathConfig->getDefaultPath()

I'm currently running a Multistore Magento 2 site, I have 4 websites configured, 2 of which have multiple URL's to access the site. As a case example I have: domain-a.com www.domain-a.com domain-a.co....
0 votes
1 answer
427 views

How can I get the url of my new module?

This is a simple Hello World in a Block, I would like how can I get the URL of this, to check the website this HelloWorld. I don't know to check my exercises, because I don't know how to get the URL ...
0 votes
1 answer
856 views

Magento 2: How to use redirect in Router.php

I am trying to redirect a cms page to a custom controller. in router.php I can check the current URL, If the current URL is as an example if it matches /test-url i want to do a redirect to /test-url-...
0 votes
1 answer
70 views

Magento 2 CMS Page URL redirect 2.3.5

I want to redirect a custom URL and change the URL path ONLY. If my URL is www.domain.com/about-company or www.domain.com/product-a-faq I want these to be shown in different URL examples -> www....
0 votes
2 answers
1k views

Magento 2 Create Module with same frontName as other module?

I have to extend functionality of Magento_Customer module and new some more controller under customer/account like customer/account/mobileVerification so my question is, Is okay to have the same ...
1 vote
0 answers
156 views

Magento 2 custom routing frontend not working (100 router match iterations)

I have used this url to change it but i am keeping getting the same erros https://magento.stackexchange.com/a/209478/96152 i have a custom routes.xml <?xml version="1.0"?> <config ...
0 votes
1 answer
607 views

How to create a custom router with url key

I'm looking to create a custom router so that if I go to www.mysite.com/promotions/cruise-trip it would route to www.mysite/offers/promotions/index/id/5 for example. I'm not really sure how to do this ...
5 votes
1 answer
530 views

Front controller reached 100 router match iterations

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 = ...
5 votes
5 answers
9k views

Custom router is not working in Router.php Magento 2 [SOLVED]

I am trying to redirect the page/action by using a custom router as Router.php, but I am getting 100 router match iterations exception. app\code\Custom\Module\etc\frontend\di.xml <?xml version="1....
5 votes
3 answers
14k views

Magento 1 - category view URL doesn't get routed, product view does

In the process of setting up my site, I have been unable to use category view links of the form: /catalog/category/view/id/ Similar links to a product view page work just fine. The above leads to ...
0 votes
1 answer
120 views

Magento 2 - all custom routing suddenly broken

I have a local Magento 2 site, not much changed recently. But all of a sudden, all custom routing, no matter what module it is from, is broken. In admin and frontend, I get 404s (from Magento, not a ...
0 votes
1 answer
107 views

Error 404 : The requested page do not exist

My target URL is: http://mylocalhost/devis/customer/printPdf But it triggers a 404 and I can't find why I have my frontend router app/code/FT/Devis/etc/frontend/routex.xml <?xml version="1.0&...
0 votes
1 answer
425 views

Custom Controller goes to 404 in Magento 2?

I have created a custom controller and die on controller execute page but it goes to 404 ? COntroller file ( path : app/code/Mageplaza/HelloWorld/Controller/Index/helloworld.php ) <?php namespace ...
2 votes
3 answers
3k views

Magento 2 admin - can no longer save configurable products after upgrade to 2.1

After upgrading from 2.0.7 to 2.1, none of my configurable products will save on edit. In the browser console I can see there is an ajax call to the Product/Validate controller that returns a 404 ...
3 votes
1 answer
2k views

Magento 2.3.5 Custom Module "Invalid security or form key. Please refresh the page"

I have created a custom module that for the most part works great, it's frontend routes work flawlessly and it hasn't had issues. Recently I attempted to create a custom admin grid by following https:/...
2 votes
1 answer
454 views

Can you redirect CMS page to custom frontend route magento 2.3.5

I am trying to redirect a cms page to a new route which I have created for frontend. I am not sure if we can redirect to the new custom module route frontend with a config in admin area. My aim is I ...
0 votes
1 answer
106 views

Custom Router not working with IndexController in the same module

I have a module with a custom router. Here's the code: di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:...
2 votes
1 answer
637 views

How to get magento 2 default route name list ? (Without third party route)

I am creating custom module which redirect to login if third party module route id find.(frontend) but i have issue how to identify the current route is default or third party route ? how to check ...
2 votes
1 answer
41 views

Changing config/connection type for consumers

I would like to set this consumers: 'async.operations.all' connection type from rabbitmq (amqp) to crontab+sql (message queue & mysqlmq)as default so my setup of external crontab can execute . ...
3 votes
3 answers
4k views

Check action noRoute (404) on Every page using Observer not working Magento 2

How to check action noRoute (404) on every page using Observer? etc/events.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
1 vote
0 answers
2k views

How do I add an id/parameter to a frontend route?

I want to add an "id"/"parameter" to a front-end route in the following way: store.example.com/blogpost/view/**213** where 213 is the parameter I want to pass. I have been looking at the Magento 2 ...
9 votes
1 answer
1k views

Reserved keyword in controller action - Magento 2

I am working on an admin grid concept. I found one github source code and analyzed that one. While I found the URL is different from the declaration in the UI component layout. <item name="url" ...
1 vote
1 answer
886 views

Magento 2: How to define Scope For Router.php

I have created Custom Module. As it requires some front-end routing, have to create Router.php Whenever I'm accessing Magento eCommece Frontend other pages, say Category/Product Page. It will call my ...
0 votes
1 answer
70 views

Magento Admin URL returns 404, after changing <use> xml parameter

I've installed a module which didn't work as expected. As a fix I tried changing the admin use parameter in the config.xml as i noticed it was the old router coding style. After changing <use>...
1 vote
3 answers
894 views

Get a route frontname by route id

I'm currently working with URL rewrites and I'm looking for a way to get the front name of a route from a module. <router id="standard"> <route id="support" frontName="faq"> &...
8 votes
1 answer
10k views

magento 2 api route with input parameter

I'm trying to create an api route with input parameters but I'm not getting the expected result. Here is my webapi.xml: <?xml version="1.0"?> <routes xmlns:xsi="http://www.w3.org/2001/...
0 votes
1 answer
381 views

Magento 2 custom route 404 without index.php

I have created a new module with my custom route. The frontname for my module is vendor and the id is vendor I have created a page with route vendor/index/index, created a controller and block for my ...
1 vote
1 answer
366 views

How do I find out where a specific route goes?

In once place, I have a /Vendor/Module/etc/routes.xml, showing: <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes....
0 votes
2 answers
380 views

Magento 2: Use a custom controller as website root?

I'm building a little module on magento2 and I can currently access it at mysite.com/test/mymodule. I want to be able to access it at mysite.com. How can I do that? I've tried doing a URL rewrite ...
0 votes
1 answer
342 views

Magento 2.X: Module URL rewrite

Magento ver. 2.3.2 I am writing a Magento 2 module. I'm trying to re-write a CMS page URL: https://www.test.com/url-test/cat1/cat2/cat3/ https://www.test.com/url-test?path=/cat1/cat2/cat3/ I have ...
3 votes
1 answer
2k views

Magento 2 : Front controller reached 100 router match iterations

I created custom router. But, when I run it display error. Front controller reached 100 router match iterations di.xml : <type name="Magento\Framework\App\RouterList"> <arguments> ...
4 votes
4 answers
2k views

Magento 2 frontend route only allow POST method

I'm using magento 2.2.5 and created a frontend route like this: <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:...
0 votes
3 answers
2k views

How to create AJAX action for POST requests in Magento 2.3?

How to create a controller action that can be requested by POST properly in own custom payment module in Magento 2.3? How to create a parent class that will be extended by classes corresponding to ...
0 votes
0 answers
17 views

Where is the code that assigns the browser's URL when clicking a button?

When I click a button that sends me to a controller action in Magento, where is the code that directs the browser to a new URL? I've been trying to trace the code with the debugger, but I can't find ...
1 vote
0 answers
44 views

Where is this text coming from at the end of my checkout URL?

I'm adding a "buy now" button to my site. I'm using the code from here. When I click the button, my site tries to go to example.com/checkout/#93=4, which then results in it going to example.com/...
0 votes
1 answer
156 views

How does routing work for product pages?

The Magento documentation says Magento URLs are built like <store-url>/<store-code>/<front-name>/<controller-name>/<action-name>, but I can't find anything about how ...
0 votes
1 answer
223 views

New route not working (2.2)

I am frustrated. I'm unable to add an ajax route in Magento 2.2 no matter what I try, I get a 404. routes.xml: <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
5 votes
0 answers
496 views

Magento 2 PWA Venia - how to set 404 page

I'm using Venia from PWA Studio and I want to create redirect to my 404 page when someone use wrong link for example "http://venia.loc/wrong-route". Page on dev environment when running "watch:venia" ...
2 votes
0 answers
188 views

Newsletter subscriber custom EDIT route Magento 2.3

I am having custom edit route for core module Magento_Newsletter Subscriber. When I access Edit route loader keeps spinning and doesn't stop. In nginx log I got: 2019/02/11 14:55:33 [error] 15820#...
8 votes
3 answers
11k views

Magento 2 CE: Front controller reached 100 router match iterations Issue

I'm using Magento 2 CE Version 2.1.0 Taking reference of http://inchoo.net/magento-2/routing-in-magento-2/ for Routing. My Router.php Controller Code public function match(\Magento\Framework\App\...
2 votes
1 answer
856 views

Magento 2 can I have 2 front names for a module?

I want to create a module for which I would like 2 frontName is it possible. if yes how can I do it ? Example 1. example.com/a/index/test 2. example.com/b/index/test both pointing to app/code/...
1 vote
1 answer
381 views

route shows user login page title

In one Magento 2.2.6 instance something very odd occurs: the meta page title shows <title>Customer Login</title> and the page title in the content also shows Customer Login - even though ...