Controller And Action Name Alias


I’ve been searching for a while now, but maybe using the wrong keywords?

I’m looking for a simple solution to translate the english names of my controllers and actions.

I got:

I want: AND

to work the same.

So I can use URL’s in the language of the website.

Simply put these hardcoded aliases in the rules section of urlManager in the main config won’t work…

It must be a simple thing, but I can’t find it :-[

Tnx a bunch!

Or should i just use the .htaccess rewriterules for this (like I use to do before I used Yii) ???

its depends totally on your code to use htaccess or URLManager.

1.) URLManager is the best way to do this as it handles both the way parsing inconing urls and converting them also.

but to use URLManager you have to specifically need to use createURL while writing any url in the application

2)if you have not used CreateURl function to write urls, you have to use .htaccess to rewrite urls and also manually rewrite urls into application also

Rewrite url from "blabla/act/<id:\d+>/" to "controllername/action/<id>"

Tnx for the response. So I understand that something like this can’t work:






				'bloogoos/lees/<id>' => 'blogs/view/<id>',


				'stukjes/lees/<id>' => 'articles/view/<id>',



And my .htaccess is btw as simple as this:

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . index.php

For the record, I manage to create the rules for use of a URL like this:

With the rule:




                'urlSuffix' => '.html',


			'blooogs/'=> 'blogs/',

			'blooogs/lees_meer/<id:\d+>/<slug:[a-zA-Z0-9-]+>'=> 'blogs/view/',	

Works great.

Just another day in Yii paradise :D