---
title: "How to Create Custom URL for Checkout Page in Magento 2?"
url: "https://magecomp.com/blog/create-custom-url-for-checkout-page-in-magento-2/"
date: "2016-02-04T18:34:54+00:00"
modified: "2025-06-06T04:57:53+00:00"
author:
  name: "Dhiren Vasoya"
  url: "https://magecomp.com/"
categories:
  - "How To"
  - "Magento 2"
word_count: 449
reading_time: "3 min read"
summary: "Sometimes you may require to change the default Magento URLs of some of the pages in order to handle and recognize them in a better way. The use of fancy URL leads you to initiate rewrite for them."
description: "Sometimes you may require to change the default Magento URLs of some of the pages in order to handle and recognize them in a better way. The use of fancy URL..."
keywords: "How To, Magento 2"
language: "en"
schema_type: "Article"
related_posts:
  - title: "Solved: cluster_block_exception [TOO_MANY_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block] in Magento 2"
    url: "https://magecomp.com/blog/solved-cluster-block-exception-magento-2/"
  - title: "How to Add Stock Filter on Category Layered Navigation in Magento 2?"
    url: "https://magecomp.com/blog/add-stock-filter-on-category-layered-navigation-magento-2/"
  - title: "How to Add Custom Validation to Address Field in Checkout in Magento 2?"
    url: "https://magecomp.com/blog/add-custom-validation-to-address-field-in-checkout-in-magento-2/"
---

# How to Create Custom URL for Checkout Page in Magento 2?

_Published: February 4, 2016_  
_Author: Dhiren Vasoya_  

![How to Create Custom URL for Checkout Page in Magento 2](https://magecomp.com/blog/wp-content/uploads/2016/02/How-to-Create-Custom-URL-for-Checkout-Page-in-Magento-2-1024x332.webp)

Sometimes you may require to change the default Magento URLs of some of the pages in order to handle and recognize them in a better way. The use of fancy URL leads you to initiate rewrite for them.

[![Hire Magento Programmer](https://magecomp.com/blog/wp-content/uploads/2025/02/Hire-Magento-Programmer-CTA-5.webp)](https://magecomp.com/services/hire-magento-programmer/)

Here we have come up with a quick solution to change URL of checkout page. From this, you can change URLs of wishlist page and customers’ my account page as well.

**Basic checkout page URL is something like:**
domain.com/checkout
domain.com/checkout/#shipping
domain.com/checkout/#payment

![Magento version upgrade](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-2-Version-Upgrade-CTA-2.webp)

**Step 1:** First, we need to create **“module.xml”** file inside extension the below directory.

**app\code\Vendor\Extension\etc**

```
<?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_Extension" setup_version="1.0.0" Schema_version="1.0.0">
        <sequence>
            <module name="Magento_Catalog"/>
        </sequence>
    </module>
</config>
```

**Step 2:** after that, we need to create **“routes.xml”** file inside extension the below directory.

**app\code\Vendor\Extension\etc\frontend**

```
<?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="customcheckout" frontName="customcheckout">
            <module name="Vendor_Extension" />
        </route>
    </router>
</config>
```

Sometimes you may face issue with mini cart update or with AJAX cart extension as you have made changes in route file of Magento. This will require you to fix up the section reloading while using AJAX.
> Easily create Custom URL for checkout page in [#magento2](https://twitter.com/hashtag/magento2?src=hash) <https://t.co/fWDH05u5Xi>
>
> — MageComp (@theMageComp) [February 15, 2016](https://twitter.com/theMageComp/status/699132332452794368)

**Step 3:** After that, we need to create **“sections.xml”** file inside extension the below directory.

**app\code\Vendor\Extension\etc\frontend**

```
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
    <action name="customcheckout/index/index">
                            </action>
</config>
```

**Step 4 :** lastly, we need to create **“Index.php”** file inside extension the below directory.

**app\code\Vendor\Extension\Controller\Index**

```
<?php
namespace VendorExtensionControllerIndex;

use MagentoFrameworkAppActionAction;
use MagentoFrameworkAppActionContext;

class Index extends Action
{
    public function execute()
    {

        // Redirect to Magento's default checkout
        return $this->_redirect('checkout');
    }
}
```

Hope you have found this effective rewrite trick useful and it will definitely help you creating fancy URLs in Magento.
[![Magento Malware Removal](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-Malware-Removal-CTA-6.webp)](https://magecomp.com/magento-malware-removal.html)
Feel free to contact if you have any queries regarding. We would appreciate your comments and suggestions.


---

_View the original post at: [https://magecomp.com/blog/create-custom-url-for-checkout-page-in-magento-2/](https://magecomp.com/blog/create-custom-url-for-checkout-page-in-magento-2/)_  
_Served as markdown by [Third Audience](https://github.com/third-audience) v3.5.3_  
_Generated: 2026-08-20 10:49:19 UTC_  
