PHPackages                             jorisnoo/statamic-locale-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. [Localization &amp; i18n](/categories/localization)
4. /
5. jorisnoo/statamic-locale-redirect

ActiveLibrary[Localization &amp; i18n](/categories/localization)

jorisnoo/statamic-locale-redirect
=================================

A Statamic addon that redirects visitors to the locale-specific home route.

0.1.1(1mo ago)0129MITPHPPHP ^8.2CI passing

Since Mar 17Pushed 1mo agoCompare

[ Source](https://github.com/jorisnoo/statamic-locale-redirect)[ Packagist](https://packagist.org/packages/jorisnoo/statamic-locale-redirect)[ RSS](/packages/jorisnoo-statamic-locale-redirect/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (3)Used By (0)

Statamic Locale Redirect
========================

[](#statamic-locale-redirect)

A Statamic addon that automatically redirects visitors from `/` to their locale-specific home route based on their browser language preferences.

Features
--------

[](#features)

- Detects the visitor's preferred language from the `Accept-Language` header
- Matches it against your Statamic multi-site locales
- Redirects from `/` to the best-matching locale home URL (e.g. `/en`, `/fr`, `/de`)
- Skips bots and crawlers to preserve SEO
- Configurable locale exclusions and restrictions
- Zero configuration required for basic usage

Requirements
------------

[](#requirements)

- PHP 8.2+
- Statamic 5 or 6

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

[](#installation)

```
composer require noordermeer/statamic-locale-redirect
```

That's it. The addon registers itself automatically via Laravel's package discovery.

How It Works
------------

[](#how-it-works)

When a visitor hits your site's root URL (`/`), the middleware:

1. Reads the `Accept-Language` header from the browser
2. Fetches all configured Statamic site locales and their URLs
3. Finds the best match between browser preferences and available locales
4. Issues a `302` redirect to the matched locale's home URL

If no match is found or the request isn't to `/`, the request passes through unchanged.

### Bot Detection

[](#bot-detection)

Bots and crawlers (Googlebot, Bingbot, etc.) are automatically excluded from redirection so they can index your root URL normally.

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

[](#configuration)

The addon works out of the box with no configuration. To customize behavior, publish the config file:

```
php artisan vendor:publish --tag=locale-redirect
```

This creates `config/statamic/locale-redirect.php`:

```
return [
    'exclude' => [],
    'only' => [],
];
```

### Exclude Locales

[](#exclude-locales)

Prevent specific locales from being redirect targets:

```
'exclude' => ['de', 'it'],
```

### Restrict to Specific Locales

[](#restrict-to-specific-locales)

Only allow redirection to specific locales. When set, `only` takes precedence over `exclude`:

```
'only' => ['en', 'fr'],
```

Testing
-------

[](#testing)

```
./vendor/bin/phpunit
```

License
-------

[](#license)

The MIT License (MIT). Please see [LICENSE](LICENSE) for more information.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance89

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 93.5% 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 ~0 days

Total

2

Last Release

54d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0440b6ac994d5566a2ef5886fbac104a73f8458e70dbd20085e241ab0f647e0d?d=identicon)[jorgenoo](/maintainers/jorgenoo)

---

Top Contributors

[![jorisnoo](https://avatars.githubusercontent.com/u/5810772?v=4)](https://github.com/jorisnoo "jorisnoo (29 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

i18nlanguagelocaleredirectstatamic

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/jorisnoo-statamic-locale-redirect/health.svg)

```
[![Health](https://phpackages.com/badges/jorisnoo-statamic-locale-redirect/health.svg)](https://phpackages.com/packages/jorisnoo-statamic-locale-redirect)
```

###  Alternatives

[aplus/language

Aplus Framework Language Library

2351.7M15](/packages/aplus-language)[vluzrmos/language-detector

Detect the language for your application using browser preferences, subdomains or route prefixes.

109554.8k3](/packages/vluzrmos-language-detector)[tractorcow/silverstripe-fluent

Simple localisation for Silverstripe

92421.6k26](/packages/tractorcow-silverstripe-fluent)[fisharebest/localization

A lightweight localization database and translation tools, with data from the CLDR, IANA, ISO, etc.

3191.1k2](/packages/fisharebest-localization)[sylius/locale

Locale handling for PHP applications.

10530.4k17](/packages/sylius-locale)[delight-im/i18n

Internationalization and localization for PHP

625.2k3](/packages/delight-im-i18n)

PHPackages © 2026

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