How to route defines in Magento 2

We use the routes.php to define route in Magento for Frontend and Adminhtml area. You have need to define frontname in routes.xml file. After that, you need the controller in your custom extension.

You can use the same front name to hit the different controller names.

<?xml version="1.0"?>
 * my moudle
  <router id="standard">
    <route id="fistparameterofurl" frontName="fistparameterofurl">
      <module name="my_module" />


Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top