Username Vanity Url

Dear all,

I am very new to the Yii framework and I want to create my first website with it.

A user can register on my website and create a user name. After the registration process he should be able to access his own page(with custom css) with the url:


where "username" stands for his username he inserted in the user registration form.

where user login with this url and access own dashboard !!!

Thank you very much for your help!


First make it by controller/action

where action

public function actionIndex($uname) {

$user = UserModel::model()->findByAttributes('username'=>$uname);

if ($user){

//everything that you want



after of that see

to make =>

0 down vote favorite


Basically i need to create a virtual sub domain for each and every user based on username in YII.

user login with own url like : is my main site

after create new test user it should be login with to

till he/she logout the url must be

i use this functionality on localhost with creating virtual host.

please help to resolve this problem

Thanks in advance.

The first is different from the second one.

check these links


this is my localhost(virtualhost) url - http://magazinecms.local/index.php?r=site/login

after login it’s url for ever user - http://magazinecms.local/index.php?r=setmagenv/index

so i want to display username after host name such as -





so user access own dashboard via this login.

i want these url after login -





Please help me, because i am very new in YII.