How to configure redirect rules
On this page, you'll find descriptions of the most common and practical scenarios for using the GeoIP Redirect extension. These step-by-step guides will help you configure GeoIP rules to automatically redirect visitors based on their location, browser language, IP address, or URL parameters. Whether you want to direct users to the appropriate store view, switch currencies, or restrict access, these examples will serve as a helpful reference for setting up your own rules.
To create new rule, navigate to System -> GeoIP Rules and click Add New Rule button in the top-right corner of the page.
Change store view for the visitors from a certain country
Goal: A user visiting the site from Germany should be automatically redirected to the German store view.
1. Fill in general information
Define the Name of the rule, for example, Redirect Germany to German store view
. Then enable the rule with the Active switcher.
Set the Priority of the rule and, if necessary, add a Note for internal use to easily identify the purpose of the rule.
2. Set the rule conditions
Choose Country option in When visitor configuration and select Germany
in appeared Country is configuration. In the When visitor on the store configuration, choose all store views except the German
store view; otherwise, this may create a redirect loop and cause server errors.
3. Specify the rule action
Enable Change store view configuration and in appeared Change store to configuration choose German
store view. Additionally, you may enable Switch currency and in Switch currency to choose Euro
for the users' convenience.
4. Save the rule
In the top-right corner of the page click the Save rule button. This rule will be automatically added to the list with all created rules and will start its work immediately, without any additional actions required from you.
Change store view for the users with a certain browser locale (language)
Goal: show the appropriate language version of the site to the customers based on their preferences.
In the previous rule, German users were redirected if their IPs were identified as German. But what if a user is from Belgium and speaks only German? This rule is similar to the previous one, so let's modify it accordingly. Steps number 1, 3 and 4 will be the same, except the step number 2. Here, we set When visitor configuration to Browser locale, and in Locale is setting select the appropriate language from the list.
Restrict access for certain IPs
Goal: block suspicious IP addresses while allowing legitimate customers to browse your store
Let's imagine that your online store is experiencing suspicious activity from a group of users, and your security team has identified a set of IP addresses associated with automated bots or malicious behavior.
You want to prevent these IP addresses from accessing your website to protect your site’s integrity and reduce server load.
By setting up When visitor -> IP and specifying suspicious range of IPs in IP is configuration in the step number 2, and enabling Restrict access with specifying the URL to redirect (e.g., /access-denied.html
) in the step number 3, you can automatically redirect all requests from those IPs to a generic error page. This action blocks suspicious users or bots from interacting with your site, while allowing legitimate visitors to continue browsing without interruption.
Redirect based on the special URL parameter
Goal: redirect a group of customers (those, who received a promo email) to a landing page.
For example, you are running a special spring marketing campaign and have sent out promotional emails to your subscriber list. Each email contains a unique link to your website with a URL parameter, such as ?promo=spring2025
.
You want users who click these links to land on a dedicated campaign landing page that highlights the special offer, rather than the regular homepage.
To do that, in the step number 2 set the When visitor -> URL parameter and specify promo
as the URL parameter name and spring2025
as the URL parameter value. In the step number 3 enable Redirect to URL and define the URL address of the desired landing page in the URL to redirect configuration (e.g., /promo/spring2025-landing
).
This ensures that everyone coming from your campaign email is instantly shown the most relevant content and offer.
Permanent redirect (restrict access) without notification
Goal: restrict access for foreign users due to legal regulations.
The following situation can occur: due to new legal regulations, your online store is temporarily prohibited from serving customers in a specific country. To comply with these laws, you need to completely restrict access for visitors from Country, ensuring they cannot browse your website or see any content. It is also important that these users are not shown any pop-ups or notifications — they should be instantly and permanently redirected to a legal notice page explaining the restriction.
To implement this rule, set the When visitor -> Country and select the required country from the Country is list in the step number 2. In the next step, number 3, enable the Restrict access configuration and define the URL to redirect (e.g., /legal-notice
).
This approach guarantees full compliance with legal requirements and delivers a clear, consistent message to restricted users.