What would be the proper way to rewrite/translate Magento 2 checkout and user account URL's to make them localized for my language?

1. Checkout

Current checkout URL's are:




2. User account

Current user account url's are:




other similar user account URL's...


You can do this by redefining the route. Create a new module that has a module.xml like so...

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="[Vendor]_[ModuleName]" setup_version="1.0.0">
            <module name="Magento_Checkout"/>

Then in your etc/frontend/routes.xml...

<?xml version="1.0"?>
<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="custom-checkout-url">
            <module name="Magento_Checkout" />

I have not looked in to other ways to do it so not sure if it is the best way but i have tested it and it worked just fine.


Because the route has now changed you need to fix up the section reloading when doing ajax. You do this with a "sections.xml" located in etc/frontend that will look something like...

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    <action name="custom-checkout-url/cart/add">
        <section name="cart"/>

Take a look in the Magento/Catalog/etc/frontend/sections.xml for all the actions you will need to override.

  • Great, that works for /checkout. What about #payment and #shipping hash?
    – g5wx
    Jan 26 '16 at 10:07
  • Note: with this solution checkout works but minicart doesn't update.
    – g5wx
    Jan 27 '16 at 10:23
  • So i create another xml (sections.xml) within the same etc/frontend of the module as where the routes.xml is located?
    – g5wx
    Jan 27 '16 at 12:37
  • Never mind, it's working. I'm also updating other url's via this solution (customer, wishilist) and so far so good. Thanks :)
    – g5wx
    Jan 28 '16 at 9:09

The easiest way is to use Magento's URL rewrite feature from your store admin section.

Here are the steps to do so for the domain.com/checkout url:

  1. In the admin menu go to Marketing -> URL Rewrites.
  2. Click the Add URL rewrite button.
  3. Select the "Custom" URL rewrite type
  4. Select the store/language for which you want to create the custom url (which will replace domain.com/checkout etc.)
  5. In the requested path field enter your new custom url, e.g. new-checkout-url (without leading slahes)
  6. In the target path field enter the current/default checkout url: checkout
  7. Clear the cache and you're done (maybe also wait for cron to reindex the urls)

The same can be done for any other in-built Magento urls (like domain.com/contact or domain.com/cart).

This is a multi-store and multi-language friendly solution and is better and easier than the accepted answer in my opinion.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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