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
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 ...
A. Andersen's user avatar
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/...
Jan-petter Havna's user avatar
0 votes
4 answers
181 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\...
Timothy Fisher's user avatar
0 votes
1 answer
332 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 ...
Elf-12's user avatar
  • 11
0 votes
1 answer
168 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....
Duncan Wardlaw's user avatar
0 votes
1 answer
429 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 ...
VictorMeanStack's user avatar
0 votes
1 answer
860 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-...
Tj1997's user avatar
  • 47
0 votes
1 answer
72 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....
Tj1997's user avatar
  • 47
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 ...
Tj1997's user avatar
  • 47
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 ...
SNAFU's user avatar
  • 176
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 ...
rita's user avatar
  • 111
0 votes
1 answer
110 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&...
Claims's user avatar
  • 1,054
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 ...
Prits's user avatar
  • 626
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:/...
joeybab3's user avatar
  • 378
2 votes
1 answer
456 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 ...
Jack Brooks's user avatar
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:...
Chaz's user avatar
  • 269
2 votes
1 answer
638 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 ...
Msquare's user avatar
  • 7,338
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 ...
Toine H's user avatar
  • 71
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>...
Michael Knudsen's user avatar
1 vote
3 answers
901 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"> &...
LyraGhost's user avatar
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 ...
Jaimin Sutariya's user avatar
1 vote
1 answer
368 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....
Gloweye's user avatar
  • 133
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
Raghu's user avatar
  • 1,710
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 ...
Badong's user avatar
  • 81
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 ...
Michael's user avatar
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:...
blue's user avatar
  • 108
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 ...
Ben Rubin's user avatar
  • 549
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/...
Ben Rubin's user avatar
  • 549
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 ...
Ben Rubin's user avatar
  • 549
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 . ...
Ed Tan's user avatar
  • 173
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-...
Yeshua's user avatar
  • 21
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> ...
Ankita Patel's user avatar
5 votes
0 answers
497 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" ...
Bartosz B.'s user avatar
2 votes
0 answers
189 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#...
Newb's user avatar
  • 85
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 ...
Kamil Szmit's user avatar
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 ...
fritzmg's user avatar
  • 717
0 votes
1 answer
546 views

Magento2 admin form routing issue

I'm trying to create a Magento extension but I'm getting an issue when accessing a custom form for submitting a new entry. The grid for showing results works fine but clicking the add new button from ...
Solide's user avatar
  • 745
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 ...
Jeyakumar T's user avatar
0 votes
1 answer
464 views

CMS page not found

I have a strange error. I created a new CMS page with url mtclp/20 and got an error page 404. If I change url on just lps, it works. If I try with, for example, test/30, It also works. Other pages ...
Ola's user avatar
  • 1
0 votes
1 answer
630 views

Magento 2 | Route has layout

I created a custom route which is working fine. However it is just a blank page. How can I add the header and the footer? Thanks!
silberfuchz's user avatar
0 votes
2 answers
38 views

Form submission

i'm new to magento. I trying to make a form to add some user to my database (not with form from magento, i need to check if the user exists in my xml file...). When I submit my form, I need to check ...
Morgan Tartreau's user avatar
1 vote
2 answers
778 views

Routing : how to specify a controller and a method for a specific URL?

How could I give the controller's name (class name) and its method in routes.xml from a plugin ? for insance, I have two front routes, and I would like them to point to : in the file MyCompany/...
Cedric's user avatar
  • 159
0 votes
1 answer
57 views

Why magento 2 has controller file for each action?

Magento 2 controller file created for each action like add,edit, delete, update, get. I want to know about the advantage of creation controllers for each action.
Hariharan's user avatar
  • 253
2 votes
0 answers
162 views

M2 - one frontend for one store in routes.xml

How can I have multiple route available for one module but different store ? I have one module that is going to be used for several stores (us / de / fr etc..) I would like to have something like : ...
Temp's user avatar
  • 63
0 votes
2 answers
976 views

change default homepage in magento2 url only for mobile theme

I have a module with 2 themes for mobile and desktop. In the mobile theme I want to change the default homepage to another url. So when the mobile detection it is activated instead to go to the ...
open-ecommerce.org's user avatar
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/...
Arun Karnawat's user avatar
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 ...
Arun Karnawat's user avatar
2 votes
1 answer
1k views

Magento 1.9.x - Debug Routing

I'm looking for advice on best practices on how to debug the routing of Magento 1.9.x efficiently. We're running into a strange issue here where we push a Mage 1.9.3.6 install from our local dev ...
pete19's user avatar
  • 163
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 = ...
Birjitsinh Zala's user avatar
1 vote
0 answers
131 views

Magento 2 custom routing error. stuck in loop?

I'm having some trouble with Router.php. I'm guessing it's the line(s) where I check the URL and return false? Exception #0 (LogicException): Front controller reached 100 router match iterations ...
user1988065's user avatar