I have a question about yii URL.
For example, ‘http://localhost/example/index.php?r=site/login’, how could I change it to ‘http://localhost/example/login’?
I am able to change it to ‘http://localhost/example/index.php/login’ by editing ‘protected/config/main.php’. Below is my urlManager setting.
'urlManager'=>array(
'urlFormat'=>'path',
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
'login' => 'site/login', // <-- new added rule
),
),
My question is how can I remove(hiding) the ‘index.php’ in ‘http://localhost/example/index.php/login’ ?