Cannot save shipping as a URL key

This article provides a workaround for the issue when you are not able to save shipping as a URL key (e.g., /shipping) for products or CMS pages. When you try to save the URL key, you receive an error that indicates that the URL key is a duplicate URL.

Affected products and versions

Adobe Commerce (all deployment methods) 2.4.x

Issue

You cannot save a CMS page with the term shipping in the URL key.

Steps to reproduce:

Create a CMS page with the URL key as shipping.

Expected result:

The page saves with shipping as the URL key.

Actual result:

You are not able to save as this error occurs:
The value specified in the URL Key field would generate a URL that already exists.

Cause

Shipping is a reserved word defined in vendor/magento/module-shipping/etc/frontend/routes.xml.


<router id="standard">
      <route id="shipping" frontName="shipping">
          <module name="Magento_Shipping" />
      </route>
  </router>

Solution

You cannot use the term shipping in your URL key - however you can use the term shipping combined with another letter or number (For example, shipping1 and shipping2).

Although the term does not have to be shipping+<another number or letter> - the term could be any string as long as the length does not exceed 255 characters.

Perform the following steps:

  1. Log in to the Adobe Commerce Admin.

  2. Go to Marketing > SEO & Search > URL Rewrites.

  3. Click Add URL Rewrite.

  4. Select Custom in the Create URL Rewrite drop-down.

    1. Type the Request Path as shipping.

    2. In the Target Path, type the new URL key (For example, “shipping1”).

    3. Select No in the Redirect drop-down.

      (Note: The Request Path is what a user enters in the browser and the Target Path is where it should redirect to.)

In addition, avoid using these keywords that are labelled as reserved keywords which cause the same exception to appear. Using any of these keywords listed below as a URL key value will cause the same error to appear.

"admin"
"adminAnalytics"
"analytics"
"api"
"backup"
"bulk"
"captcha"
"catalog"
"catalogsearch"
"checkout"
"cms"
"contact"
"cookie"
"customer"
"directory"
"downloadable"
"giftmessage"
"groupedProduct"
"indexer"
"instantpurchase"
"loginascustomer"
"marketplace"
"mui"
"multishipping"
"newsletter"
"oauth"
"paypal"
"persistent"
"productalert"
"releaseNotification"
"reports"
"review"
"robots"
"rss"
"sales"
"search"
"security"
"sendfriend"
"shipping"
"stores"
"swagger"
"swatches"
"tax"
"theme"
"translation"
"vault"
"wishlist"
recommendation-more-help
8bd06ef0-b3d5-4137-b74e-d7b00485808a