How To Change The Path Of Url?

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’ ?

http://www.yiiframework.com/doc/guide/1.1/it/topics.url

http://www.yiiframework.com/wiki/214/url-hide-index-php/

Hi,

set ‘showScriptName’ to false


'urlManager'=>array(

    ...

    'showScriptName'=>false,

    ....       

),