9

Is it possible to get the list of all routes in a Magento 2 environment? I am looking some command-line tool, if there is any?

Note: I had a bin/rails routes command to list all the routes in rails framework, and I am looking something similar to this.

4
  • 2
    I wrote a similar tool a long time ago. The code is already deleted, but I can share the basic steps for this tool. Are you interested? Jan 3, 2018 at 15:53
  • My good beloved rails...
    – sissy
    May 18, 2018 at 11:19
  • Hi @AndreyKonosov, after long time, yes I am interested :). May 31, 2019 at 16:41
  • It is really disappointing there is not any way to list all the routes. May 31, 2019 at 16:43

2 Answers 2

1

Yes, using n98:

n98-magerun.phar config:dump frontend/routers

3
0

Using n98-magerun2:

n98-magerun2.phar route:list

Example output:

+-----------+-----------------------------+-------------------------------------+-------------------------------------------------------------------+
| Area      | Frontname                   | Module                              | Route                                                             |
+-----------+-----------------------------+-------------------------------------+-------------------------------------------------------------------+
| frontend  | stores                      | Magento_Store                       | stores/store/redirect                                             |
| frontend  | stores                      | Magento_Store                       | stores/store/switchrequest                                        |
| frontend  | stores                      | Magento_Store                       | stores/store/switch                                               |
| frontend  | stores                      | Magento_Store                       | stores/store/switchaction/cookiemanager                           |
| frontend  | directory                   | Magento_Directory                   | directory/currency/switch
...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.