> For the complete documentation index, see [llms.txt](https://help.spicegems.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.spicegems.com/geoip-country-redirect/country-redirect/url-mapping.md).

# URL Mapping

Redirect users from Old Destination URL to a specific New Destination.

The URL Mapping feature is designed to redirect visitors from a 404 page in the destination store to an available page in the destination store. This will ensure a smooth transition from an unavailable page to an available page.

With **URL Mapping**, you can redirect users from an **Old Destination URL** to a **New Destination URL**.

**Example Scenario:**

You have two Shopify stores:

* **USA Store** → **geoip-country-redirect-demo.myshopify.com**
* **Canada Store** → **sg-local-app.myshopify.com**

A **Shirt** product exists in both stores. However, the **shirt in the Canadian store became unavailable**. Instead of users landing on a broken or unavailable page, you want to **redirect them to an alternative product page**.

**How URL Mapping Works:**

**If a user tries to visit:** \
Product URL in the USA store: **<https://geoip-country-redirect-demo.myshopify.com/products/shirt-1>**

Instead of being redirected to the same product URL in the Canadian store (**sg-local-app.myshopify.com/products/shirt-1**), they will be redirected to (**sg-local-app.myshopify.com/products/shirt-2)** (a new mapped URL in the app).

This ensures a smooth user experience by redirecting visitors to an **active and relevant product page** instead of a discontinued or unavailable one.

### Step 1: Click on Edit Redirection Rule&#x20;

<figure><img src="https://2119731643-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lo5KC5Ta6Fs1-alV4Av%2Fuploads%2FJefO84TNG9dvoPMmll2c%2FCR_pagespecific-1.png?alt=media&amp;token=c85f88be-8dcf-4cdc-ac89-0817576e312e" alt=""><figcaption></figcaption></figure>

### Step 2: Navigate to “Advance Setting”

<figure><img src="https://2119731643-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lo5KC5Ta6Fs1-alV4Av%2Fuploads%2Fso95TtMzC5pCse1FoyMz%2FCR_URLmapping-2.png?alt=media&amp;token=1009e3ed-e162-4c4f-b799-c3bda69d26ab" alt=""><figcaption></figcaption></figure>

### Step 3: Activate the URL Mapping option

Click on Checkbox to activate the URL Mapping functionality

{% hint style="info" %}
**Note:** The [**Relative redirect**](/geoip-country-redirect/country-redirect/relative-redirect.md) setting must be enabled for the **URL Mapping** functionality to work.
{% endhint %}

<figure><img src="https://2119731643-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lo5KC5Ta6Fs1-alV4Av%2Fuploads%2FXhAMC6TM4f9EI8tADwyi%2FCR_URLmapping-3.png?alt=media&amp;token=b19dc03a-211b-42c9-9e46-41d7c0786ea4" alt=""><figcaption></figcaption></figure>

### Step 4: Add “URL Mapping”&#x20;

Click on the **"Add Mapping"** to add the URLs for the mapping

<figure><img src="https://2119731643-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lo5KC5Ta6Fs1-alV4Av%2Fuploads%2F1PhpDS7OIxhwlDFOxoVY%2FCR_URLmapping-4.png?alt=media&amp;token=65a3a76c-1df6-4650-8e8e-87008daa496b" alt=""><figcaption></figcaption></figure>

### Step 5: Add path/URL in "Redirect From" and Select the Type

* &#x20;**Redirect From** – Enter the path/URL from which you want to redirect the visitors to the new destination URL.&#x20;
* **Type**:\
  **Exact** –Redirect users when the exact path is matched in the “Redirect from” field. It requires a complete URL to be added in the Redirect From field.\
  **Contains** – Redirect users when the contents added in the Redirect from field is detected. The **/path** is required to be added if the **Contains** type is selected.

Examples of Exact and Contains:

For **Exact** - add the URL  \[**sg-local-app.myshopify.com/products/shirts-1]**\
For **Contains** - add the path \[**/products/shirts-1]**

<figure><img src="https://2119731643-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lo5KC5Ta6Fs1-alV4Av%2Fuploads%2FI1xeayJNIWo6oiLTTpXt%2FCR_URLmapping-5.png?alt=media&amp;token=fcb36c45-6871-442a-8030-9b6108252c62" alt=""><figcaption></figcaption></figure>

### Step 6: Select the type in the **"Redirect To"** field and add the destination URL in the **"New Destination URL"** field.

**New Destination URL** – Add the New Destination URL on which you want to redirect visitors.&#x20;

* **Origin:** Add the required **/path** of the new page. This will redirect visitors to the new **Destination URL**.
* **Origin + Locale:** Add the **/path** and it will add locale to the path (if available)
* **Full URL:** Add the complete URL of the New destination page.&#x20;

**Examples of the above options:**

**With Origin:** Add the path **/products/shirt-2**\
**With Origin + Locale:** Add the path **/products/shirt-2.** This will add the language locale to the URL **en/products/shirt-2**\
**With Full URL:** Add the complete **URL - <https://sg-local-app.myshopify.com/products/shirt-2>**

<figure><img src="https://2119731643-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lo5KC5Ta6Fs1-alV4Av%2Fuploads%2FLERqSNgOnGTyy5vwFb7Q%2FCR_URLmapping-6.png?alt=media&amp;token=1118176b-d07b-455c-80bf-0e9fda807cf1" alt=""><figcaption></figcaption></figure>

### Step 7: Click on Save to apply the changes

<figure><img src="https://2119731643-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lo5KC5Ta6Fs1-alV4Av%2Fuploads%2FIoyVWuJ84tpRTIGAk7Ib%2FCR_URLmapping-7.png?alt=media&amp;token=3407d20f-8031-4dc4-b873-8b88eff8ae3d" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**In case of any queries, please feel free to reach us at** [**help@spicegems.com**](mailto:help@spicegems.com)
{% endhint %}
