Remove query string to Yii URL

In Yii1.x all we had to do was add path something like’


urlManager'=>array(     'urlFormat'=>'path',      ............. )

But in Yii2 its gone. How do I make my URLs without query-string something like


http://example.com/forum/post/id/2014/make-yii2-work




    	'urlManager' => [

        	'enablePrettyUrl' => true,

        	'showScriptName' => false,

        	'enableStrictParsing' => false,

        	'rules' => [

            	'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',

            	'<controller:\w+>/<action:\w+>' => '<controller>/<action>',

        	],

    	],



Its not working giving url like


http://localhost/web/forum/topic?id=3

instead of


http://localhost/web/forum/topic/id/3

Here is my URLManager components in config


'urlManager' => [ 

        	'enablePrettyUrl' => true,

        	'showScriptName' => false,         	

        	//'enableStrictParsing' => true, 

        	'rules' => [   

            	'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',

            	'<controller:\w+>/<action:\w+>' => '<controller>/<action>',         	

        	],

    	],

Try changing to:







'urlManager' => [ 'class' => 'yii\web\UrlManager', 

        // Disable index.php 

        'showScriptName' => false, 

        // Disable r= routes 

        'enablePrettyUrl' => true, 

        'rules' => [

        '<controller:\w+>/<id:\d+>' => '<controller>/view', 

        '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>', 

        '<controller:\w+>/<action:\w+>' => '<controller>/<action>',

        '<controller:\w+>/<id:\d+>/<slug:[A-Za-z0-9 -_.]+>' => '<controller>/view',      

        ],



This is tested and working for me.

No it does not work either. Any reason why path was removed? I found it useful.

Any Discussion in GitHub that documents it?

http://www.yiiframework.com/doc-2.0/guide-runtime-routing.html#using-pretty-urls