# Setup the app for redirection

Let’s start understanding how to setup the app to redirect visitors from one store to another store/domain/sub-domain/URLs.

To better understand we are taking an example:

> If you have two stores, one for **Canada (Local store)** and one for the **USA (Global store)**
>
> and you want to manage the traffic on both stores as mentioned below:
>
> 1. Only Canadian visitors can access the local store and all visitors except Canadians would be redirected to the global store.
> 2. If Canadian visitors land on the global store then they would be redirect on the Local store.

<figure><img src="https://2670149893-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FufSz9Fn2Bq257KnKEgiT%2Fuploads%2FNVdC2mw8OwOOAx1Ux2uh%2Fredirect_illustrate.png?alt=media&#x26;token=1ec5b466-c577-4851-8799-6515becb61af" alt=""><figcaption></figcaption></figure>

In this case, you need to install our app on both stores as you want to manage the traffic from both stores and setup the redirection rules as mentioned below on both stores:

{% hint style="info" %}
It is recommended to review the[ interpretation of the redirect rule](interpretation-of-a-redirect-rule) before moving on to creating redirect rules.
{% endhint %}

#### Setup app on Global store:

> "If Canadian visitors land on the global store then they would be redirect on the Local store."

To manage the Canadian traffic on the global store we need to create only one rule in the app

**Redirect rule**: Redirect Canadian visitors to the local store.

Here is the interpretation of the rule:

* **Rule Name:** Local Rule (you can use any name as per your need)
* **Visitors Country:** Add the Canada
* **Redirect To Store URL:** Local store URL (we are taking "sg-localapp.myshopify.com")
* **Store Name:** SG LocalApp Canada (you can use name as per you need)
* **Redirection Type:** Auto Redirection

{% content-ref url="create-redirect-rule" %}
[create-redirect-rule](create-redirect-rule)
{% endcontent-ref %}

#### Setup app on Local store:

> "Only Canadian visitors can access the local store and all visitors except Canadians would be redirected to the global store."

We have two requirements to manage the traffic on the Local store

1. Only Canadian visitors can access this store
2. All visitors except Canadians should be redirected on the Global store.

Both requirements can be achieved by creating just one redirect rule

**Redirect rule**: redirect all visitors except Canadians on the Global store.&#x20;

Here is the interpretation of the rule:

1. **Rule Name:** Global Rule (you can use any name as per your need)
2. **Visitors Country:** Add all countries except Canada
3. **Redirect To Store URL:** Global store URL (we are taking "line-item.myshopify.com")
4. **Store Name:** Line Item USA (you can use the name as per your need)
5. **Redirection Type:** Display-based redirection (we are using pop-up for the redirection)

{% content-ref url="create-exception-based-redirect-rule" %}
[create-exception-based-redirect-rule](create-exception-based-redirect-rule)
{% endcontent-ref %}
