Yii 2.0: yii2-localeurls

Automatic locale/language management for URLs

Yii2 Locale URLs

Automatic locale/language management through URLs for Yii 2.

Features ΒΆ

With this extension you can use URLs that contain a language code like:


You can also configure friendly names if you want:


The language code is automatically added whenever you create a URL, and read back when a URL is parsed. For best user experience the language is autodetected from the browser settings - but the user can still access other languages simply by calling a URL with another language code.

The last requested language is also persisted in the user session and in a cookie. So if the user tries to access your site without a language code in the URL, he'll get redirected to the language he had used on his last visit.

All the above (and more) is configurable of course.

For more details check out the project on github:


Total 4 comments

#19350 report it
waterloomatt at 2015/05/28 01:32pm
Great Extention

You've saved me several hours of work. Thanks!

#19272 report it
m3hr@n at 2015/05/05 06:08am
opening new issue at github

sure @mike

Here is the link of issue: https://github.com/codemix/yii2-localeurls/issues/19

#19271 report it
Mike at 2015/05/05 04:04am
Re: redirect loop after logout

Hi, can you please open a new issue over at github? I can't track bugs here.

#19269 report it
m3hr@n at 2015/05/05 02:18am
redirect loop after logout

First of all TNX for your great extention!

I'm using advanced template for my project and I run into a problem with your extention.

Everything works fine except when user logout. logout will redirect to home url with the default language at the end (like this: http://example.com/fa), but it has a redirect loop and home page will never shown till user delete the default language from address bar(like this: http://example.com).

Also "enableDefaultLanguageUrlCode" has its default value(I mean it is false).

What am I doing Wrong? Or maybe its an issue?

Leave a comment

Please to leave your comment.

Create extension
No downloadable files yet
  • Yii Version: 2.0
  • License: MIT License
  • Developed by: Mike
  • Category: Others
  • Votes: +6
  • Downloaded: 0 times
  • Created on: Oct 15, 2014
  • Last updated: never
  • Tags: url, i18n