IP Geolocation Redirect for Magento 2

IP GeolocationRedirect
View Demo

Show each visitor the store view and currency that fit their country, browser language or IP address.

Redirect to any page, ask before switching, or restrict access by country, while search bots and cached pages keep working as usual.

  • Switch the store view by country, browser language or IP
  • Show prices in the visitor's currency
  • Keep visitors on the same page in their store view
  • Redirect to any URL or restrict access
  • Ask with a confirmation popup before switching
  • Work with Varnish out of the box, no VCL changes
  • Skip search bots and excluded pages
Marketplace Approved
Hyvä
Magento Cloud
WCAG
Mage-OS
Compatible with:
Community:
2.3.* - 2.4.9
Enterprise:
2.3.* - 2.4.9

Show Every Visitor Their Own Store

A shopper from Germany lands on your US store, sees prices in dollars and wonders whether you ship to Berlin at all. Many leave instead of looking for the language switcher.

IP Geolocation Redirect detects the visitor's country from their IP address, along with their browser language, and applies your rules: switch to the right store view, show prices in the local currency, send the visitor to a specific page, or restrict access. Search engine bots are not redirected, so every store view stays crawlable. It works with Varnish and full page cache out of the box, on Magento Open Source and Adobe Commerce.

  • Store switcher by country: Visitors from France get your French store view, visitors from Canada with a French browser can get it too, and everyone else stays where they are.

  • Currency switcher by country: Prices show in the visitor's currency as soon as the rule matches, with or without a store view change.

  • They stay on the page they opened: A visitor who arrives on a product page lands on the same product in their store view, not on its home page.

  • No VCL changes for cached pages: The location check runs after the cached page loads, so redirects keep working behind Varnish.

How the Redirect Rules Work

A condition, an action, a priority

Each rule matches visitors by one condition:

  • country
  • browser language
  • country and browser language together, for example Canada with a French browser
  • IP address
  • a URL parameter, for campaign links and testing

When a rule matches, it can do one or more of these:

  • switch to a store view, and with it the store language
  • switch the currency
  • redirect to any URL, including a separate site for that region
  • restrict access by sending the visitor to a page you choose

A rule can apply to all store views or only to the ones you select. When several rules match, they are applied in priority order, so a specific IP rule can override a broader country rule. The rule setup guide walks through common scenarios.

Works with Varnish and Full Page Cache

Cached pages, live redirects

A cached page is the same for every visitor, so a redirect decided on the server can't reach visitors who get the page from Varnish. IP Geolocation Redirect solves this with Ajax mode, which is on by default: the page is served from cache as usual, then the module checks the visitor's location and switches the store view or currency, or redirects. You don't need to edit your VCL.

You choose whether rules run only on the first visit or on every visit. The visitor's choice is remembered in the session or in a cookie, for as long as you set.

Key Features of IP Geolocation Redirect

Keep visitors on the same page

With Redirect destination set to Same Page, the module finds the equivalent page in the target store view, so a product stays a product. If there is no match, the visitor goes to that store's home page.

Ask before switching

Switch silently, show a notification, or show a confirmation popup where the visitor accepts or stays. You write the popup text; the interface is translated into 15 languages, and screen readers announce the popup buttons.

Restrict access by country or IP

Send visitors from a country or IP address to a page of your choice instead of the store, for example a notice that you don't sell in their region.

Search bots are not redirected

Googlebot and Bingbot are skipped by default, and you can add any other user agent. You can also exclude IP addresses, such as your office, from all rules.

Exclude pages

List the pages where the module should do nothing, one pattern per line with * as a wildcard, for example a launch page you share with invited customers. Add a store code to a pattern to exclude the page in one store view only.

Test rules from another country

Debug mode lets you substitute an IP address from any country for your own requests only, so you can check each rule while real visitors are not affected.

The real visitor IP behind a CDN

Behind Cloudflare or another proxy, every request can seem to come from the proxy. Choose which header carries the visitor's IP, such as CF-Connecting-IP or X-Forwarded-For; the settings show the IP each header currently returns.

Two ways to detect the country

Use the GeoLite2 database, which the module downloads and updates weekly with a free MaxMind account, or the ip-api.com service without a key. Failed lookups are written to a log, and visitors keep browsing normally.

Show each visitor the right store view and currency from the first page they open.

This product includes GeoLite2 data created by MaxMind.

No hidden fees
Our developers install the extension on your store and configure it for your setup, free of charge.
Lifetime access to source code
Access to free support and updates for 1 year
Updates and support prolongation - $90

Pay today $149 for the first year.

Then $90 for updates and support services per year.

Cancel anytime.

30 days money back guarantee
See it in action!
Pick a quick tutorial to learn about various aspects of this extension
Customer Reviews 6
Earn points for your review about this extension modules. $1 = 10 points
Write Your Own Review

check-circle You submitted your review for moderation.

sb Verified Buyer
From Hasselt, Netherlands
Using the module for 4 months
No more language worries
Now every customer sees our store in the right language and prices. Easy to use.
Also installed:
Follow Up Email,  Advanced Reports,  Full Page Cache Warmer,  Improved Sorting,  Mass Product Actions,  Advanced SEO Suite,  Layered Navigation and 9 more
Anzi Verified Buyer
From Celje, Slovenia
Using the module for almost 1 year
Simple integration of great feature
Again one of great modules from Mirasvit. Very easy to integrate on site.
Also installed:
Follow Up Email,  Improved Sorting,  Elastic Search Ultimate,  Google Tag Manager,  Surcharge & Additional Payment Fee
Faisal Verified Buyer
From Bahrain
Using the module for almost 1 month
Perfect Extension
The extension works well as expected. And the support team are very helpful and will help you solve any issue that would arise!

Also installed:
Automatic Related Products,  Google Tag Manager,  Advanced Product Feeds,  Advanced SEO Suite,  AI Assistant,  eChat,  Facebook Pixel & Conversion API and 8 more
Gokhan Verified Buyer
From Aydin, Turkey
Using the module for 3 months
Nice extension
I love mirasvit. All extension very useful
Also installed:
Advanced Product Feeds,  Elastic Search Ultimate,  Follow Up Email,  Help Desk MX,  Reward Points,  Full Page Cache Warmer,  Google PageSpeed Optimizer and 9 more
Wu Verified Buyer
From China
Using the module for over 1 month
Good extension with nice UI
The extension works as expected. The first version I got block the POST request from the payment gateway so I reached out to the team. Mirasvit team fixed it quickly.

If the extension can support path exception, it will be perfect.
Manual & Support
Need more help?

Save time by starting your support request online and we'll connect you to an expert.

Frequently asked questions
chevron-down chevron-right

What is IP geolocation redirect and why would a store use it?

It shows each visitor the version of your store that fits their location: the right store view, language and currency, detected from their IP address and browser language. Visitors don't have to find the language or currency switcher themselves.

It doesn't hurt SEO when it's set up the usual way: Googlebot and Bingbot are not redirected by default, so search engines can still crawl every store view.

chevron-down chevron-right

How does IP Geolocation Redirect decide where to send a visitor?

You create rules. Each rule matches visitors by country, browser language, country and browser language together, IP address, or a URL parameter, and then switches the store view, switches the currency, redirects to a URL, or restricts access. You can try the rules in the backend demo.

A rule can switch the store view and the currency at the same time. If you enable the confirmation popup, the visitor accepts the switch or stays on the current store.

Conditions match the values you list. There is no "is not" condition, so to cover all countries except one, add the countries you need to the rule.

chevron-down chevron-right

Where can visitors be redirected?

A rule can switch to any store view of your Magento installation, including store views on other domains, or redirect to any URL, such as a separate site for that region.

With Redirect destination set to Same Page, the visitor lands on the equivalent page in the target store view, with the home page as a fallback. To keep some pages out of geo processing, list them in Excluded URLs.

chevron-down chevron-right

What can a redirect rule do?

Each rule has a condition (country, browser language, both together, IP address, or URL parameter), one or more actions (switch store view, switch currency, redirect to URL, restrict access) and the store views it applies to.

Each rule also has a priority, which decides the result when several rules match the same visitor.

chevron-down chevron-right

Why might the redirect not work?

The most common reason is page caching such as Varnish. Ajax mode, which is on by default, checks the location after the cached page loads; if it was turned off, turn it back on.

Behind Cloudflare or another proxy, choose the header that carries the real visitor IP in Remote IP key. If the country can't be detected, the reason is written to var/log/mirasvit/geo-ip.log.

chevron-down chevron-right

Why do customers see the redirect popup again after they already made a choice?

The visitor's answer is stored in the session or in a cookie, depending on the Redirect data storage setting. When the session or cookie expires, the module no longer knows the choice and shows the popup again.

Choose cookies and set a longer Storage lifetime to remember the choice for longer.

chevron-down chevron-right

Do I need to buy a MaxMind license?

No. The module uses the free GeoLite2 database by MaxMind. You need a free MaxMind account: enter its Account ID and License Key in the settings, and the module downloads the database and updates it weekly. You can also download it with bin/magento mirasvit:geolocation:download.

If you don't want to create an account, switch the lookup source to the ip-api.com service, which needs no key.

chevron-down chevron-right

Does it work behind Cloudflare or another CDN?

Yes. Behind a CDN or proxy, the server can see the proxy's IP instead of the visitor's. In Remote IP key, choose the header that carries the real IP, such as CF-Connecting-IP for Cloudflare or X-Forwarded-For. The setting shows the IP each header currently returns, so you can see which one is right.

chevron-down chevron-right

Will it interfere with checkout or payment callbacks?

The module acts only on regular page views (GET requests), so form submissions and payment callbacks sent as POST requests are not redirected. To keep specific pages out of geo processing completely, add them to Excluded URLs.

Changelog
Version 1.4.0Oct 19, 2026
Hyvä support now ships with the extension — The companion package mirasvit/module-geo-ip-hyva is gone: the redirect popup and the script behind store, currency and redirect rules are part of GeoIP Redirect itself, and one template now serves Luma and Hyvä alike, on every supported Magento version including 2.3. There is no longer an extra package to find and keep in step, and a Luma store gets nothing it does not use. Composer removes the companion package by itself when you upgrade, and a project composer.json that still requires mirasvit/module-geo-ip-hyva keeps installing without errors — GeoIP Redirect now stands in for it.
⚠️ On Hyvä, rebuild the theme styles after upgrading — The popup's Hyvä styling now comes from this module's own Tailwind source instead of the companion package's inline styles, so run these once after setup:upgrade, then deploy static content as usual:
⚠️ Theme overrides move to one template — The popup is Mirasvit_GeoIp::js.phtml on both themes. An override of Hyva_MirasvitGeoIp::js.phtml in a Hyvä theme, or of the Mirasvit_GeoIp/js/popup / Mirasvit_GeoIp/js/process scripts (or a RequireJS mixin on them) in a Luma theme, is no longer read — silently, with no error. Move such customisations onto Mirasvit_GeoIp::js.phtml. The Hyva_MirasvitGeoIp module no longer exists.
⚠️ For developers: the storefront script is plain JavaScript now, with no jQuery, Knockout or Alpine. The window events it listens to and fires keep their names (mstGeoIpPopupOpen, mstGeoIpProcessRedirectAccept, mstGeoIpProcessRedirectDone, …), and a jQuery $(window).on(…) handler still receives them, but any payload is now in event.detail. Block\Js::getJsConfigProcess() and getJsConfigPopup() are replaced by getConfigJson(), the popup config no longer carries isShowRequest, and the block's constructor no longer takes WorkflowService.
On Hyvä, the popup now opens the way it always did on Luma: without AJAX mode it follows the visitor's cookie, so it works behind the full-page cache instead of being decided once and served to every visitor of a cached page. Accept switches the store directly, as on Luma, the popup text shows the formatting entered in the admin instead of the raw tags, the popup can be closed with its close button or the Escape key, and it opens above the page header — it used to be able to open underneath one.
On Luma, the protection against a broken redirect cookie that Hyvä stores received in module-geo-ip-hyva 1.0.2 now applies too: a cookie without a destination is ignored instead of reloading the page in a loop, and Accept falls back to the store's own accept step instead of opening a /null page.
The popup's mst-geo-ip CSS class is present from the first frame, so custom popup styles no longer flash in after it opens.
A rule with both Change store and Redirect to URL now takes the visitor to that URL in the new store — /sale.html on a German rule opens the German store's sale page. It used to switch the store and stay on the current page (or the store's home page), ignoring the redirect URL, unless a ?___store= parameter was added to it by hand. Enter the URL without a store code; it is matched to the target store's own address of that page. This works whether the store is switched on page load, in AJAX mode or from the popup's Accept button, and a currency or redirect rule that runs afterwards keeps the visitor on that page in the new store.
Version 1.3.5Oct 8, 2026
A Geo IP rule whose stored conditions or actions can't be read (for example, after the rule's database row was edited by hand or by a third-party import) is now reported through Mirasvit Core's degradation reporting, with the rule ID. Before, it was quietly treated as empty with no trace. The rule still matches nothing, so visitors are never redirected on settings nobody can verify.
Removed an unused storefront popup template that was never displayed. Its leftover button handlers called functions that don't exist in the module. The geo-redirect popup's Accept and Decline buttons work exactly as before. The now-unused "Reject geo-location based recommendations" text was dropped from all translation files.
Fixed same-page store redirects dropping the URL query string. When a visitor was redirected to the same page in their geo-matched store view, parameters such as ?utm_source=…, ?omnisendContactID=… and other campaign or tracking parameters were lost. They are now carried over for every page, including the home page (/?utm_source=x). Magento's store-switch parameters (___store, ___from_store, uenc) are removed from the carried query so they can't send the visitor back to the original store.
Fixed the Geo IP rules grid (System > IP Geolocation Redirect > IP Geolocation Rules) forgetting your column visibility, filters and sorting after you left the page. The grid now saves its view state, as other admin grids do.
Fixed a PHP warning logged on every storefront request when a rule with the "URL parameter" source was saved with a parameter name but no value. Such a rule now matches any URL that contains the parameter, whatever its value.
Version 1.3.4Jul 28, 2026
Excluded URLs — New setting under Stores > Configuration > Mirasvit > Geo IP > Limitations that lists pages where geo processing is skipped entirely: no store or currency switch, no redirect, no restriction and no popup — and the visit is not counted as the visitor's first visit. Enter one path pattern per line, using * as a wildcard (for example /contact or /promo/*); matching ignores letter case and a trailing slash. Prefix a pattern with a store code (/en_us/contact) to exclude the page in that store view only; without a prefix it applies to every store view of the website. Patterns that would match every page (/ or /*) are rejected on save, so the module cannot be switched off by accident.
Translatable admin and storefront text — Every label, field description and popup message can now be translated, including the field comments on the Geo IP configuration page and the accept/reject button labels read out by screen readers in the redirect popup. Ready-made translations ship for 15 locales: Arabic, Chinese (Simplified), Czech, Dutch, French, German, Italian, Japanese, Polish, Portuguese (Brazil and Portugal), Spanish, Swedish, Turkish and Ukrainian.
Failed country lookups are now written to var/log/mirasvit/geo-ip.log. Previously, when the GeoLite2 database was unavailable or the ip-api.com service did not respond, visitors were simply left unmatched with no trace of the cause — now the reason is recorded while visitors keep browsing normally.
⚠️ Requires Mirasvit Core 1.7.15 or later (installed automatically via Composer).
Version 1.3.3May 5, 2026
Country and Browser Locale condition — New rule condition that matches visitors on both their country and browser locale simultaneously.
Infinite redirect loop on stores with sub-folder base URLs (e.g. /us/, /fr/) when "Redirect Destination" is set to "Same Page"
When a rule had both "Switch Currency" and "Redirect to URL" actions enabled, visitors were stuck in a redirect loop and the confirmation popup did not appear
Version 1.3.2Apr 14, 2026
Redirect destination — New setting under Stores > Configuration > Mirasvit > Geo IP that controls where visitors land after a geo-redirect. "Home Page" (default) always sends visitors to the target store's home page. "Same Page" resolves the equivalent URL on the target store so visitors continue from where they were, with automatic fallback to the home page when no match is found.
Reasons to choose Mirasvit
Client focusing and satisfaction

These are our primary. A major portion of our new clients come from referrals from our existing clients. Our professional team of developers, marketers and support staff have invested the best knowledge and experience in the field into our work, so you know you can come back to us again and again.

Remarkable support

One year free and high quality support. We go to great lengths to provide maximum satisfaction with every module you have purchased in our store. By helping you with installation, configuration, answering your every question, we do all our best to eliminate any possible problems.

Risk-free Investment

30-days money back guarantee. If you are not satisfied with our extension performance for any reason, we provide a full refund.

Constant improvements and upgrades

We constantly add new features to all our modules, and are always interested in hearing your opinion and implementing your suggested features in our future developments.

Comprehensive Documentation

We provide an expanded user guide for every aspect of our extension, so you can find answers for all your burning questions.

Unencrypted source code of our products

You can customize extension according to your needs and requirements.

Usability and Performance

The Module is easy to install and upgrade, just follow our step-by-step user guide. Additionally, the extension is ready to use with the Hyvä theme.

Ready for Magento Cloud

No core modifications. The extension has been tested in a Magento Cloud environment and is fully compatible with it.

Loading...