PHPackages                             mage-os/module-maxmind-geoip-redirect - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. mage-os/module-maxmind-geoip-redirect

ActiveMagento2-module[HTTP &amp; Networking](/categories/http)

mage-os/module-maxmind-geoip-redirect
=====================================

Manages geoip redirect using integration with the MaxMind GeoLite2

2.0.0(2mo ago)61582MITPHPPHP ^8.1

Since May 15Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/mage-os-lab/module-maxmind-geoip-redirect)[ Packagist](https://packagist.org/packages/mage-os/module-maxmind-geoip-redirect)[ RSS](/packages/mage-os-module-maxmind-geoip-redirect/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (14)Used By (0)

MageOS MaxMind GeoIP Redirect
=============================

[](#mageos-maxmind-geoip-redirect)

Magento module for GeoIP-based redirect using the free [GeoLite2](https://dev.maxmind.com/geoip/geolite2-free-geolocation-data) service by MaxMind.

This module provides a fully open source alternative to commercial GeoIP redirect modules, with built-in support for both IPv4 and IPv6 and full compatibility with Varnish.

---

Installation
------------

[](#installation)

```
composer require mage-os/module-maxmind-geoip-redirect
```

```
bin/magento module:enable MageOS_MaxMindGeoipRedirect
```

```
bin/magento setup:upgrade
```

---

Features
--------

[](#features)

- Detects user country via IP address (GeoLite2)
- Supports both API and local database modes
- Offers a configurable popup to suggest redirection
- Compatible with Varnish
- Fully configurable per store view
- IPv4 and IPv6 compatible

---

Configuration
-------------

[](#configuration)

Navigate to: `Stores > Configuration > Mage-OS > MaxMind GeoIP Redirect`

### 1. General (global scope)

[](#1-general-global-scope)

- **Enable**: Enable or disable the module.
- **Force an IP for testing**: Override user IP for testing purposes.
- **IP check method**:
    - **API webservices**: Real-time geolocation, limited to 1000 requests/day.
    - **Downloaded local database**: Offline geolocation, limited to 30 downloads/day.
- **Cron expression for IP database import** (only for local database mode): Define how often to update the local database.
- **Last IP database import** (read-only): Shows the date of the last database download.
- **Confirmation Redirect Popup Text**: Customize the popup message. Use `{{geolocated_country}}` to dynamically include the country name.
- **Confirmation Redirect Popup accept/decline button text**: Customize the popup button text.
- **Confirmation Redirect Popup language mode**: Select the language for pop-up texts and buttons from the current store, target store, or global language.

### 2. GeoLite2 Settings (global scope)

[](#2-geolite2-settings-global-scope)

- **Account ID**: From your MaxMind account.
- **License key**: From your MaxMind account.
- **Database URL**: URL to fetch the GeoLite2 database.

> Notes and links to retrieve these credentials are included in the admin comments.

### 3. Country Redirect Settings (per store view)

[](#3-country-redirect-settings-per-store-view)

Change scope to the desired store view to configure these settings (mandatory for mapping countries, optional for mapping currencies):

- **Affected Countries**: List of countries associated with this store view.
- **Country to Currency Mapping**: Match each country with its preferred currency.

### 4. Restriction (global and per store view)

[](#4-restriction-global-and-per-store-view)

- **Excepted IPs**: IPs excluded from geolocation and redirect logic.
- **Excepted URLs**: URLs excluded from geolocation and redirect logic.
- **Excepted User Agents**: Typically used for bots, crawlers, or specific tests.
- **First visit redirect only**:
    - `Yes`: Show popup only on first visit.
    - `No`: Show popup on every visit if country mismatch is detected.
    - **Recommendation**: Use `No` for single-domain setups, `Yes` for multi-domain setups.

---

Notes
-----

[](#notes)

### API vs Downloaded Database: Which One to Choose?

[](#api-vs-downloaded-database-which-one-to-choose)

The module supports two methods for resolving IP geolocation using MaxMind's GeoLite2 service:

#### 1. API Webservices (Real-time)

[](#1-api-webservices-real-time)

- **Advantages**:
    - Always up-to-date data — the geolocation results are as accurate as MaxMind’s latest updates.
    - No need for local storage or cron configuration.
- **Disadvantages**:
    - Free plan limited to 1000 API calls per day — not suitable for medium to high traffic sites.
    - Requires internet connectivity for every geolocation call.
    - If MaxMind’s API is down, geolocation fails.

#### 2. Downloaded Local Database (Offline Mode)

[](#2-downloaded-local-database-offline-mode)

- **Advantages**:
    - Works completely offline — ideal for high traffic sites and when uptime is critical.
    - Extremely fast IP resolution thanks to optimized local lookup.
    - Not dependent on MaxMind uptime during normal operations.
    - **Allows you to avoid API rate limits — the free plan allows up to 30 downloads/day.**
- **Disadvantages**:
    - Requires setup of a cron job to download and refresh the local database.
    - Accuracy depends on how often the database is updated (typically daily is enough).

#### When to Use What

[](#when-to-use-what)

- **Use API Mode**:

    - If your site has low daily traffic (less than 1000 unique visits needing geolocation).
    - You want the most accurate and up-to-date geolocation without local maintenance.
- **Use Local Database Mode**:

    - If your site exceeds 1000 visits/day or must guarantee geolocation even in offline scenarios.
    - You prefer performance and stability over real-time precision.
    - You are already managing cron jobs and can schedule the download within the 30/day limit.

In general, local database mode is recommended for production environments, especially when performance and robustness are priorities.

---

License
-------

[](#license)

[MIT](LICENSE)

---

Credits
-------

[](#credits)

Powered by [GeoLite2](https://dev.maxmind.com/geoip/geolite2-free-geolocation-data) data created by MaxMind.

---

Support
-------

[](#support)

This module is provided as-is under an open source license. For contributions, bug reports, or feature requests, feel free to open a GitHub issue or submit a pull request.

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance89

Actively maintained with recent releases

Popularity20

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 89.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~22 days

Recently: every ~33 days

Total

13

Last Release

89d ago

Major Versions

0.0.1 → 1.0.02025-06-02

1.5.0 → 2.0.02026-02-12

PHP version history (2 changes)0.0.1PHP ^8.3

1.3.0PHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/100189073?v=4)[Mage-OS](/maintainers/mage-os-ci)[@mage-os-ci](https://github.com/mage-os-ci)

---

Top Contributors

[![SamueleMartini](https://avatars.githubusercontent.com/u/40766441?v=4)](https://github.com/SamueleMartini "SamueleMartini (33 commits)")[![annv99](https://avatars.githubusercontent.com/u/190375859?v=4)](https://github.com/annv99 "annv99 (2 commits)")[![Irinina](https://avatars.githubusercontent.com/u/82020146?v=4)](https://github.com/Irinina "Irinina (2 commits)")

### Embed Badge

![Health badge](/badges/mage-os-module-maxmind-geoip-redirect/health.svg)

```
[![Health](https://phpackages.com/badges/mage-os-module-maxmind-geoip-redirect/health.svg)](https://phpackages.com/packages/mage-os-module-maxmind-geoip-redirect)
```

###  Alternatives

[dotdigital/dotdigital-magento2-extension

Dotdigital for Magento 2

50374.2k18](/packages/dotdigital-dotdigital-magento2-extension)[yireo/magento2-linkpreload

Magento 2 extension to set HTTP Link headers for primary resources to allow for HTTP/2 preloading

92343.7k1](/packages/yireo-magento2-linkpreload)[loki/magento2-admin-components

N/A

151.6k5](/packages/loki-magento2-admin-components)[developersalliance/module-table-rates

This module allows administrators to manage and view shipping table rates from the admin UI.

443.4k](/packages/developersalliance-module-table-rates)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
