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)
)
)
...
ineersa
(Ineersa)
June 6, 2013, 8:43am
3
If you use
<controller>/<action>
rule in your Url manager then in your controllers just define default action:
public $defaultAction = 'index';
See question again, I’ve made some change
xsysys
(Kumark)
June 6, 2013, 10:31am
5
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" .
Tsunami
(Erik)
June 6, 2013, 11:12am
7
Use this URL rule:
'<controller>'=>'<controller>/index',
No one is understanding what I want!
Hmm…