PHPackages                             webexcess/redirecthandler-localization - 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. webexcess/redirecthandler-localization

ActiveNeos-package[Localization &amp; i18n](/categories/localization)

webexcess/redirecthandler-localization
======================================

Create shortcuts which get redirected to the matching language and region dimension of the visitor.

1.1.0(4y ago)33021[1 issues](https://github.com/webexcess/redirecthandler-localization/issues)MITPHP

Since Dec 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/webexcess/redirecthandler-localization)[ Packagist](https://packagist.org/packages/webexcess/redirecthandler-localization)[ RSS](/packages/webexcess-redirecthandler-localization/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)Dependencies (2)Versions (6)Used By (0)

WebExcess.RedirectHandler.Localization for Neos CMS
===================================================

[](#webexcessredirecthandlerlocalization-for-neos-cms)

[![Logo](logo.png)](Documentation/logo-512.png)[![Latest Stable Version](https://camo.githubusercontent.com/8625a4172bab6c660c91b62fa3394b19f8a3cb0343fb50e791d8a5298dcb4bb5/68747470733a2f2f706f7365722e707567782e6f72672f7765626578636573732f726564697265637468616e646c65722d6c6f63616c697a6174696f6e2f762f737461626c65)](https://packagist.org/packages/webexcess/redirecthandler-localization)[![License](https://camo.githubusercontent.com/bb12352c91911353dcc0c4ce1745bcaca24ecd677feb0c20d909f2d123a46306/68747470733a2f2f706f7365722e707567782e6f72672f7765626578636573732f726564697265637468616e646c65722d6c6f63616c697a6174696f6e2f6c6963656e7365)](https://packagist.org/packages/webexcess/redirecthandler-localization)

This package allows to create [Neos.RedirectHandler](https://github.com/neos/redirecthandler) shortcuts which gets redirected to the matching language and region dimension of the visitor.

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

[](#installation)

```
composer require webexcess/redirecthandler-localization

```

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

[](#configuration)

- **dimensionIdentifiers.linguistic** (string)
    - The key of your linguistic dimension, default: 'language'
- **dimensionIdentifiers.regional** (string)
    - The key of your regional dimension, default: not set
- **overwriteDefaultDimensionUriSegment** (array)
    - A list of "dimensionIdentifier: defaultDimensionUriSegment": default: empty
    - Use this to overwrite the default uri segment per dimension
    - Example: `overwriteDefaultDimensionUriSegment.language: 'en'`
- **ipinfoToken** (string)
    - The token to the ipinfo.io webservice, default: '' (for non-commerical use)
    - Add [your own token](https://ipinfo.io/) if you need more than 1,000 requests a day
    - Disable the token, to use the pecl geoip
    - Or implement your very own implementation of the `LocalizationInterface`

Usage
-----

[](#usage)

Instead of adding a speaking url to "target uri path", add the node identifier like: `node://ad798967-8662-4c6f-b1d1-4c8188038d23`.

```
flow redirect:add source node://ad798967-8662-4c6f-b1d1-4c8188038d23 302

```

Or use the [WebExcess.RedirectHandler.Backend](https://github.com/webexcess/redirecthandler-backend) package.

Simple Example
--------------

[](#simple-example)

A site with language dimensions.

### Existing dimension configuration

[](#existing-dimension-configuration)

```
Neos:
  ContentRepository:
    contentDimensions:
      language:
        label: Language
        icon: icon-language
        default: en
        defaultPreset: en
        presets:
          de:
            label: German
            values:
              - de
              - en
            uriSegment: de
          fr:
            label: French
            values:
              - fr
              - en
            uriSegment: fr
          it:
            label: Italian
            values:
              - it
              - en
            uriSegment: it

```

### RedirectHandler.Localization configuration

[](#redirecthandlerlocalization-configuration)

No configuration needed.

Advanced Example
----------------

[](#advanced-example)

A site with language and country dimensions which is using ipinfo.io to geolocate the visitors ip address.

### Existing dimension configuration

[](#existing-dimension-configuration-1)

```
Neos:
  ContentRepository:
    contentDimensions:
      language:
        label: Language
        icon: icon-language
        default: en
        defaultPreset: en
        presets:
          de:
            label: German
            values:
              - de
              - en
            uriSegment: de
          fr:
            label: French
            values:
              - fr
              - en
            uriSegment: fr
          it:
            label: Italian
            values:
              - it
              - en
            uriSegment: it
          # ...
          en:
            label: English
            values:
              - en
            uriSegment: en
      country:
        label: Country
        icon: icon-globe
        default: GLOBAL
        defaultPreset: GLOBAL
        presets:
          GLOBAL:
            label: Global
            values:
              - GLOBAL
            uriSegment: ''
          CH:
            label: Schweiz
            values:
              - CH
              - GLOBAL
            uriSegment: CH
            constraints:
              language:
                '*': false
                de: true
                fr: true
                it: true
                en: true
          DE:
            label: Deutschland
            values:
              - DE
              - GLOBAL
            uriSegment: DE
            constraints:
              language:
                '*': false
                de: true
                en: true
          # ...
          ZA:
            label: 'South Africa'
            values:
              - ZA
              - GLOBAL
            uriSegment: ZA
            constraints:
              language:
                '*': false
                en: true

```

### RedirectHandler.Localization configuration

[](#redirecthandlerlocalization-configuration-1)

*Objects.yaml*

```
WebExcess\RedirectHandler\Localization\Service\LocalizationInterface:
  className: WebExcess\RedirectHandler\Localization\Service\LanguageAndCountryLocalization

```

*Settings.yaml*

```
WebExcess:
  RedirectHandler:
    Localization:
      dimensionIdentifiers:
        linguistic: 'language'
        regional: 'country'
      overwriteDefaultDimensionUriSegment:
        country: 'CH'
      ipinfoToken: '1234567890'

```

Custom Example
--------------

[](#custom-example)

You can add your own LocalizationInterface implementation.

All you have to return in the getTargetContext function is a valid context array, for example:

```
Array
(
    [dimensions] => Array
        (
            [language] => Array
                (
                    [0] => de
                    [1] => en
                )

            [country] => Array
                (
                    [0] => CH
                    [1] => GLOBAL
                )

        )

    [targetDimensions] => Array
        (
            [language] => de
            [country] => CH
        )

)

```

---

developed by [webexcess GmbH](https://webexcess.ch/)

sponsored by [Blaser Swisslube AG](https://www.blaser.com/)

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 83.3% 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 ~371 days

Total

5

Last Release

1635d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bdc5710fe83fa49841c7cb3e78547601637f220833db59d268302803317dcbc2?d=identicon)[webexcess](/maintainers/webexcess)

---

Top Contributors

[![sbruggmann](https://avatars.githubusercontent.com/u/1162368?v=4)](https://github.com/sbruggmann "sbruggmann (5 commits)")[![samuelhauser](https://avatars.githubusercontent.com/u/1894064?v=4)](https://github.com/samuelhauser "samuelhauser (1 commits)")

---

Tags

backend-modulesneosneos-cmsneos-pluginneoscms

### Embed Badge

![Health badge](/badges/webexcess-redirecthandler-localization/health.svg)

```
[![Health](https://phpackages.com/badges/webexcess-redirecthandler-localization/health.svg)](https://phpackages.com/packages/webexcess-redirecthandler-localization)
```

###  Alternatives

[sitegeist/lostintranslation

Automatic content translations for Neos using the DeepL Api

1240.9k4](/packages/sitegeist-lostintranslation)[neos/form-builder

Flow Form Framework integration into Neos CMS

19358.8k19](/packages/neos-form-builder)[neos/neos-base-distribution

Neos Base Distribution

4265.4k](/packages/neos-neos-base-distribution)[neos/demo

Site package for the Neos Demo Site

18184.0k8](/packages/neos-demo)[flownative/nodeduplicator

Copy nodes from one dimension to another to create a base for translating for example.

1034.5k](/packages/flownative-nodeduplicator)[kaufmanndigital/gdpr-cookieconsent

A ready-to-run package, that integrates an advanced cookie consent banner into your Neos CMS site.

2541.8k](/packages/kaufmanndigital-gdpr-cookieconsent)

PHPackages © 2026

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