Setup the app for redirection
Last updated
Last updated
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:
Only Canadian visitors can access the local store and all visitors except Canadians would be redirected to the global store.
If Canadian visitors land on the global store then they would be redirect on the Local store.
Local Store (sg-localapp.myshopify.com)
Global Store (line-item.myshopify.com)
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:
It is recommended to review the interpretation of the redirect rule before moving on to creating redirect rules.
"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 (you can use name as per you need)
Redirection Type: Auto Redirection
How to create redirect rule in the app?
"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
Only Canadian visitors can access this store
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:
Rule Name: Global Rule (you can use any name as per your need)
Visitors Country: Add all countries except Canada
Redirect To Store URL: Global store URL (we are taking "line-item.myshopify.com")
Store Name: Line Item USA (you can use the name as per your need)
Redirection Type: Display-based redirection (we are using pop-up for the redirection)
In this type of rule you need to add all countries except some specific countries, which can be easily achieved by exception-based rule creation.