PHPackages                             fedemotta/localeurls - 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. fedemotta/localeurls

ActiveYii-extension[Localization &amp; i18n](/categories/localization)

fedemotta/localeurls
====================

localeurls is a Yii extension for automatic locale/language management through URLs.

v1.2.1(10y ago)111MITPHPPHP &gt;=5.0.0

Since Feb 20Pushed 10y ago1 watchersCompare

[ Source](https://github.com/fedemotta/localeurls)[ Packagist](https://packagist.org/packages/fedemotta/localeurls)[ Docs](https://github.com/fedemotta/localeurls)[ RSS](/packages/fedemotta-localeurls/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)DependenciesVersions (10)Used By (0)

Locale URLs
===========

[](#locale-urls)

[![Latest Stable Version](https://camo.githubusercontent.com/f6e8b7a13629a19e43f222b3686a3ff7e6bbda9809191bec19f939606bd85add/68747470733a2f2f706f7365722e707567782e6f72672f666564656d6f7474612f6c6f63616c6575726c732f762f737461626c65)](https://packagist.org/packages/fedemotta/localeurls) [![Total Downloads](https://camo.githubusercontent.com/e37b272fc805fb4ef80cf2d27f8f160ce79b7d5aa92799c4b3da037ae47add77/68747470733a2f2f706f7365722e707567782e6f72672f666564656d6f7474612f6c6f63616c6575726c732f646f776e6c6f616473)](https://packagist.org/packages/fedemotta/localeurls) [![Latest Unstable Version](https://camo.githubusercontent.com/7be40a6a5347aefdad864b0ced6c0fb45ccf6ddab385bec7361c9b05a2a21bef/68747470733a2f2f706f7365722e707567782e6f72672f666564656d6f7474612f6c6f63616c6575726c732f762f756e737461626c65)](https://packagist.org/packages/fedemotta/localeurls) [![License](https://camo.githubusercontent.com/5ee7eb23f316f750052aa0b42e4b914a52910b720655b49e951a1300ea9f85a1/68747470733a2f2f706f7365722e707567782e6f72672f666564656d6f7474612f6c6f63616c6575726c732f6c6963656e7365)](https://packagist.org/packages/fedemotta/localeurls)

Automatic locale/language management for URLs.

**This is a real long-term fork of [mikehaertl/localeurls](http://github.com/mikehaertl/localeurls) repository, which is currently in manteinance mode. With release 1.2 there is a redirectDefaultTo param to encourage the selection of a valid language if the user never selected one before. You can see this feature in action in .**

This extension allows to use URLs that contain a language code like

```
/en/some/page
/de/some/page
http://www.example.com/en/some/page
http://www.example.com/de/some/page

```

Since 1.1.3 you can also configure friendlier language names if you want:

```
http://www.example.com/english/some/page
http://www.example.com/deutsch/some/page

```

The language code is automatically inserted into every URL created and read back on every request. No extra URL rules are required. For best user experience the language is also restored from session/cookie if the user returns to a URL without a language code.

Installation
============

[](#installation)

Extract the package to your `protected/extensions` directory and rename it to `localeurls`. Then configure the components in your `protected/config/main.php`:

```
