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

1
vote
0answers
15 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
27 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#...
0
votes
2answers
45 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 ...
1
vote
1answer
27 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 ...
0
votes
1answer
23 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 ...
0
votes
0answers
70 views

Magento 2: admin base URL for UI Components

There is BASE_URL variable on the adminhtml pages (see ./vendor/magento/module-backend/view/adminhtml/templates/page/js/require_js.phtml): <html> <head> <script> ...
1
vote
1answer
212 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
0answers
28 views

create a page according with the identifier URL

I have created a custom grid and added identifier field, now how to create a url like http://domain.com/identifier in frontend please find the below screenshot Thanks
0
votes
1answer
60 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 ...
0
votes
1answer
81 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!
0
votes
2answers
26 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 ...
0
votes
0answers
14 views

Custom routing in magento

I want to create one custom page in magento 1.9 e.g www.mymagentowebsite.com/section www.mymagentowebsite.com/section/subsection1 www.mymagentowebsite.com/section/subsection2 www.mymagentowebsite....
1
vote
2answers
39 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/...
0
votes
1answer
45 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.
0
votes
0answers
23 views

change static block links route based on condition

I need to change the path of one of footer links based on condition (for example, for "logged in" customers one link and for "not logged in" customers different link). Is it possible?
0
votes
0answers
40 views

How to list custom webapi routes in magento 2?

How to list custom webapi routes in magento 2? "custom webapi routes" : all the webapi routes except the ones from Magento itself => so routes are from all the plugins installed.
2
votes
0answers
77 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 : ...
0
votes
2answers
132 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 ...
0
votes
0answers
100 views

Magento 2.2.2 custom route requires /index in url

In Magento 2.0 I could create a route with the following XML: <router id="standard"> <route id="vendor" frontName="module"> <module name="Vendor_Module" /> </...
1
vote
1answer
206 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/...
0
votes
1answer
283 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 ...
0
votes
1answer
283 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 ...
1
vote
0answers
54 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 ...
4
votes
1answer
46 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 ...
0
votes
1answer
20 views

How to append module url to an area?

So I have a module (Menu) that I built following a tutorial and I want to treat it as an area. I then want to build other modules (I have Magento's Hello World module currently integrated for testing) ...
1
vote
1answer
210 views

Disable all customer related routes

I'm building a Magento 2.2 store and would like to remove all customer pages like login, account, register, etc. I noticed that I can remove all customer routes (customer/ * / *) when I remove the /...
0
votes
1answer
100 views

Getting all Magento 1.9 controller urls

I've inherited a large magento application with a huge number of extensions, and have been tasked with finding all accessible urls which match certain criteria (meaning I must look manually). I'm ...
0
votes
1answer
304 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:...
0
votes
2answers
20 views

Magento 2 : How to Copy whole admin panel in custom route

I want to create the whole admin panel in my custom route, like here is the default method is 192.168.1.57/magento/admin to 192.168.1.57/magento/demoroute with all the functionalities of admin.
1
vote
1answer
52 views

Magento2 - is it possible to specify multiple urls in api?

I would like to know is it possible to (call) specify multiple URLs in a single route webapi.xml ? Ex:- <?xml version="1.0"?> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
9
votes
1answer
3k 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/...
11
votes
1answer
308 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 ...
0
votes
1answer
267 views

How to change magento home page with non cms page?

I have one page www.abstract.id/landingpage and I wanna make it as my home page, and the url changed to www.abstract.id I have a block, controller, etc, helper and the frontend xml & page.phtml
3
votes
2answers
1k 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
1answer
87 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"> ...
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 ...
0
votes
1answer
64 views

Set module frontname programatically

In my magento admin area, admin can set a name to be displayed on the contact us page. For example, admin can set "contact-us" as the url-alias and I want to set that as the frontname of my contacts ...
2
votes
0answers
155 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: ...
4
votes
3answers
3k 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....
2
votes
1answer
842 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:...
0
votes
1answer
758 views

Magento 2: How to use redirect in Router.php file [SOLVED]

As following Magento 2: How to define Scope For Router.php we already have if ($condition->getRedirectUrl()) { $this->response->setRedirect($condition->getRedirectUrl()); $...
0
votes
1answer
537 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 ...
6
votes
3answers
3k 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\...
0
votes
1answer
28 views

can i add more than 1 pages in a module in magento?

I already have a module and i want to create new page which redirected from 1st of my module. I want to know how to create more than 1 page in a module and also how to link pages.
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 ...
1
vote
1answer
41 views

Define custom homepage

We have a Dashboard package which can be accessed as follows: www.shop.be/dashboard. How can we make sure that this always is the homepage? So, www.shop.be will always show the dashboard instead of ...
2
votes
1answer
581 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?
0
votes
0answers
20 views

Give the option in admin to change custom module route on frontend [duplicate]

Say on frontend your main module page is www.website/test/ etc/frontend/routes.xml: <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:...
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 ...
0
votes
1answer
550 views

magento routing not works when i enabled 'Add Store Code to Urls' in admin

when i change Add Store Code to Urls to yes at system > web > url options in admin panel, all the routing to my controller is not works. returns 404 error page. how to resolve this?