Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [routing]

Denotes questions related to the routing mechanism of Magento

70
votes
5answers
17k views

How to check which modules are affected by security patch SUPEE-6788

On October 27, 2015, Magento has released security patch SUPEE-6788. According to the technical details, 4 APPSEC's that have been fixed require some rework in local and community modules: APPSEC-...
32
votes
3answers
22k views

How to update admin routers of custom module for patch SUPEE-6788

I'm not sure how to update custom modules to work with the SUPEE-6788 patch, the instructions are not very clear. Based on Alan Storm's tutorial, I created a simple module in the generator www....
11
votes
1answer
328 views

Using Reserved Words in Magento 2 URLs

Is it possible to create a module in Magento 2, using standard routing, that responds to a URL in the form of http://magento.example.com/namespace_module/return/index That is -- a URL where the ...
9
votes
3answers
499 views

Why Does Magento 2 Force URLs to be 3+ Characters

If you attempt to create a module with a front name like hello-world in Magento 2, you'll get an error that looks like this. Invalid XML in file /Users/alanstorm/Sites/magento-2-with-keys/magento2/...
8
votes
1answer
4k 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/...
7
votes
3answers
4k 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\...
7
votes
4answers
2k views

Magento EE 1.13 catalog routing

UPDATE Below is the original question, and while it's related to what the issue ends up being, it's tangential. Please see the edits starting with number 2 for more useful background information On ...
7
votes
1answer
531 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" ...
7
votes
1answer
879 views

Magento 2: Why Does My Custom Controller Generate an Interceptor?

I recently created a basic routing configuration for a test module <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/...
6
votes
5answers
1k views

Load review form on external page

By default the Magento URL for the review form is: www.domain.com/(producturl)-reviews#review-form. But in this page the review-form is a section in the reviews page. I want to load the review-form ...
6
votes
3answers
3k views

Disable admin or frontend route

Is there a way to disable an admin route, well actually any route. The use case is I have an extension that comes with a frontend section and an admin section but I do not want the admin section to be ...
6
votes
1answer
237 views

Using the secret admin frontname in a new adminhtml router

I have a module that uses an abnormal naming convention. Instead of NAMESPACE_MODULE it uses NAMESPACE_MODULE_SUBMODULE: $ find app/code/community -type f app/code/community/Acme/ModuleName/Bar/etc/...
5
votes
1answer
2k views

Magento 2 admin custom route results in 404 error

I'm beginning with Magento CE 2.1 and I'm stuck with an admin custom route issue that results in a 404 error. I created a module named 'VM_import' and get it registered (checked). Now i try to ...
4
votes
3answers
14k views

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 ...
4
votes
3answers
4k 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....
4
votes
1answer
957 views

Can multiple modules share a frontName in routes.xml?

In my current project I have developed several modules to add different pieces of functionality. I'd like the admin of each module to be managed from a shared frontName, for example: ...
4
votes
1answer
2k views

How Magento 2 Routing Works

I need to know how magento 2 Routing Works... I want to know that when we request for any task in magento 2 then how its process to controller... Like I used command line console...' Then how my ...
4
votes
2answers
2k views

How does home page routing work

A module usually contains a routes.xml file which, as I understand it, specifies the routes which the module handles. I would like to know how routing is handled for the home page, for example for ...
4
votes
1answer
48 views

Page not found while trying access controller with parameter in url

i created a simple controller like this: namespace Namespace\Module\Controller\Confirm; class Index extends \Magento\Framework\App\Action\Action { protected $resultPageFactory; public ...
3
votes
1answer
240 views

Overwriting controller vs overwriting action controller request

I'm busy working though Grokking Magento by Vinai Kopp, and reached a part where he explains where he explains how to rewrite requests to (eg) the checkout/cart controller, and he gives an example of ...
3
votes
1answer
702 views

Show 404 Page When Route isn't found?

When I enter a malformed product view URL, or something similar where the URL is correct but can't be handled (invalid ID for example) Magento sends me to the "CMS No Route Page" in Configuration > ...
3
votes
1answer
37 views

Magento extension that adds code before_body_end OR header based on route/uri I select

We were Googling to find an extension that maybe existed that adds code (or not_ based on certain routes. Based on the router it either adds some code in before_body_end or header. Much like Config-&...
3
votes
0answers
61 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> ...
3
votes
0answers
26 views

Enterprise Catalog Routing & Rewrites [duplicate]

I'm working on a Magento Enterprise site and I'm having an issue figuring out how catalog routing and rewrites work in EE 1.14.1.0. In Magento CE, the core_url_rewrite table is used to transform a ...
2
votes
2answers
365 views

Using __call in a controller

Is there any examples of using __call in a controller to replace a specific action method. I have a situation where I need to provide different endpoints to the same controller. A reference to each ...
2
votes
2answers
3k views

Admin router redirects to dashboard

I am trying to create a custom controller in admin side. My config file as below: <admin> <routers> <salesref> <use>admin</use> ...
2
votes
1answer
2k views

Magento2: check if url is an admin url

I've 2 websites UK (default) and IN . I'm using PHP geo-location library to re-direct customers to Indian website based on their IP which is working fine on frontend. $geoipPath = 'lib/geoip/geoip....
2
votes
1answer
4k views

Magento Core Routes

Does anybody know of a comprehensive list of Magento Core's routes? I'm sure I could create a pretty accurate list by parsing the controller files for Action methods, I'm just wondering if anybody ...
2
votes
2answers
2k 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:...
2
votes
2answers
1k 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 ...
2
votes
2answers
565 views

Magento 2: How to Set controller, module, action name? [duplicate]

I want to do these codes like in magento 1 $request->setModuleName('catalogsearch') ->setControllerName('advanced') ->setActionName('result'); and then the page load content ...
2
votes
1answer
640 views

What is the purpose of Mage::getUrl?

How is the Mage::getUrl() method useful? Why can't I just use a normal relative link?
2
votes
2answers
157 views

How do I stop further controller processing when using a controller before=“OtherController”?

I have a controller which is configured to handle requests prior to the core controller using a config.xml similar to this; <frontend> <routers> <catalogsearch> <args&...
2
votes
1answer
932 views

How is Magento 2 RouterList Populated?

How does Magento2 populate its $routerList in : public function dispatch(RequestInterface $request) { \Magento\Framework\Profiler::start('routers_match'); $routingCycleCounter = 0; $...
2
votes
1answer
95 views

Custom controller reuses Magento front name

I've added custom controller under magento frontName and it works. My routes.xml: ... <router id="standard"> <route id="customer" frontName="customer"> ...
2
votes
1answer
400 views

_isUrlInternal method in Mage_Core_Controller_Varien_Action failing due to port number

i am implementing the currency switcher on my 1.5.1.0 CE site. it's a fairly straightforward implementation, but for some reason, once i select a currency, i get redirected to the homepage rather than ...
2
votes
0answers
14 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 . ...
2
votes
0answers
60 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
0answers
49 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#...
2
votes
0answers
94 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 : ...
2
votes
0answers
158 views

How does “front name” of a module affect its routing?

This is a question that comes to me as i faced below situation: I had an extension with front-name: "csmymodule". I changed its front-name with: "mymodule". But I notice that both these urls work: ...
2
votes
1answer
884 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
2answers
201 views

Custom Module Controller not working

I have built a custom Module for my client's site where I have been putting my overrides and observers, built a helper class, etc. It has been working fine to now. I am trying to add a Controller, ...
1
vote
3answers
274 views

How to override a bad extensions controllers?

Synopsis I am trying to extend an admin controller of a module, however the frontend router and adminhtml router share the same frontname. I've tried so many things and none of them are working. ...
1
vote
1answer
241 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
1answer
1k views

Configuring custom admin routing

I'm having some issues setting up admin routing. My menu.xml file is as follows, note the custom route /manufacturer/grid. <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
1
vote
1answer
2k views

disable redirect after add to cart [duplicate]

How to disable redirect to the cart page when adding a product to cart? What has to be done so that the user remains on the same page when adding a product to the cart?
1
vote
2answers
1k views

Different frontNames for each store

I've got a module which works fine, however I need a different frontName for each store. The stores are 'english' and 'french', and as such, the frontName should be translated for each. I've tried a ...
1
vote
1answer
36 views

/index/ in URLs - Required?

In particular, I'm working on a Magento site with a custom module that is only accessible if you include /index/ at the end of the module's frontend route. So the route is setup like this: <...
1
vote
2answers
51 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/...