Always Redirect To Index

How can I redirect always to index instead controller only:

If user visits /xxx then this will be redirected to xxx/index


'urlManager' => array(

  'rules' => array(

	'xxx' => 'xxx/index', // Redirect right here to "xxx/index"

   // Something like

   'xxx' => array('xxx/index', 'redirect' => true, 'code' => 301)




could be more specific

If you use


rule in your Url manager then in your controllers just define default action:

public $defaultAction = 'index';

See question again, I’ve made some change

if no action is specified after controller then default action will be loaded, for each controller index is the default action. this we can specify like this public $defaultAction = ‘index’;

I know,

But I want to redirect to "/xxx/index", if user has visited only Controller("/xxx"). No output for "/xxx".

Use this URL rule:


No one is understanding what I want!