want to change default url from site/index to mycontroller/myaction

I am stuck in the problem,want to change default url from site/index to mycontroller/myaction…although it seems very simple but unable to do that please help me asap…and also i have tried extending Cwebuser


class WebUser extends CWebUser


public function test()


	echo	&#036;test='dddd';



	   return &#036;test;




You can say that a dummy function so that i would call this function in index.php(placed at root) it is doing nothinngggggggggg…as I am not very familiar about extending the core classes…Is my approach wrong

Hi sonam,

No need to extend anything. All you have to do is open up protected/config/main.php and add the following to the config array:

return array(

    'basePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..',

    'name' => 'My application',

    'defaultController' => 'myController/myAction',   // <--- add this line and replace with correct controller/action

thanks worked

How did u know this, or find a list of all available parameters that you can add to that array. which page :)

Read the guide from the beginning and look at the demo applications shipped with the framework.

Then you should also browse the class documentation. I would suggest to start at the CWebApplication class (there you will find defaultController as a property) which is the "main" entry point of the framework which handles requests, components,…

Every time you need to know e.g. available properties/methods of a class first search within the class documentation. For code use cases search the guide and the forum (use extended search in the forum cause the normal search not always gives the correct results. Could be that it is already fixed now…).

An other good method to become familar with the framework is to read the forum (questions area) like I did . At the beginning you will not understand a lot of things but after a while you become quite familar with the whole framework.

+rep its work