# Setup the app for redirection

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

> 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="/files/PyLBqEhbg7BDdS5mRLDA" 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](/geoip-country-redirect-legacy/interpretation-of-a-redirect-rule.md) 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="/pages/Hhma3m1Eim3yb6uv5jhu" %}
[Create Redirect Rule](/geoip-country-redirect-legacy/create-redirect-rule.md)
{% 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.

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="/pages/VnxTeusVOkuHpDE12yKk" %}
[Create Exception-Based Redirect Rule](/geoip-country-redirect-legacy/create-exception-based-redirect-rule.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.spicegems.com/geoip-country-redirect-legacy/setup-the-app-for-redirection.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
