Questions tagged [routing]

Denotes questions related to the routing mechanism of Magento

Filter by
Sorted by
Tagged with
2
votes
1answer
35 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
1answer
23 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:...
1
vote
1answer
69 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 ...
1
vote
0answers
71 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 ...
0
votes
1answer
25 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
3answers
100 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"> &...
0
votes
1answer
67 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
1answer
34 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
2answers
77 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
2answers
89 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
1answer
157 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 ...
0
votes
0answers
19 views

Magento 2 Intercept Route

I got a small question. I have custom products/categories in my shop. Now depending on the user, it may or may not visit the specific category or product. Is there an event or another way to 'hook' ...
4
votes
4answers
565 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
0answers
11 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
0answers
38 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
1answer
22 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 ...
2
votes
1answer
31 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 . ...
0
votes
1answer
57 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-...
3
votes
1answer
604 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> ...
5
votes
0answers
165 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
107 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
3answers
804 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
179 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
129 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 ...
1
vote
1answer
879 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
1answer
287 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
289 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
30 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 ...
1
vote
2answers
273 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
50 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.
2
votes
0answers
120 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
541 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 ...
2
votes
1answer
449 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
654 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
1answer
858 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
95 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
56 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
421 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
273 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
611 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
25 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
181 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-...
8
votes
1answer
6k 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
457 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
334 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
3answers
3k 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
118 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
3k 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
66 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 ...