1

For example http://magento2.loc/checkout changed to http://magento2.loc/supercheckout

Thank you for answer.

3 Answers 3

1

Modify frontName tag in below direction

[VendorName]/[ModuleName]/etc/frontend/routes.xml

if you want change frontend route of extension

[VendorName]/[ModuleName]/etc/adminhtml/routes.xml

if you want change backend route of extension

More example you can see in nice clear module: vendor/magento/module-cms

1
  • I changed the name in the core - it works . But I need to change the names in my module.
    – gebuket
    Dec 25, 2015 at 10:37
0

This link may help you..........http://inchoo.net/magento-2/routing-in-magento-2/

http://inchoo.net/magento-2/routing-in-magento-2/

1
  • 2
    I read it . It says how to create a router , but does not say how to change its name without affecting the core.
    – gebuket
    Dec 25, 2015 at 10:28
-1

Go to vendor\magento\module-checkout\etc\frontend\routes.xml Change the following code

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="standard">
        <route id="checkout" frontName="checkout">
            <module name="Magento_Checkout" />
        </route>
    </router>
</config>

TO

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="standard">
        <route id="checkout" frontName="supercheckout">
            <module name="Magento_Checkout" />
        </route>
    </router>
</config>

Please note if you are making changes for id attribute of route to "supercheckout", You need to change all the layout files in vendor\magento\module-checkout\view\frontend\layout folder with the starting name as "checkout" to "supercheckout" e.g. files will be checkout_cart_configure.xml to supercheckout_cart_configure.xml and so on.

1
  • 2
    Changing a core module like this is never a good idea, it is an especially bad idea when the core is in vendor as this is managed by composer and could be changed with a minor version update. Oct 20, 2017 at 5:05

Your Answer

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

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