How can I create a pretty url like this customer/index/amount/12000/location/in . In Yii1.1 it was available by default. it was easy to enable pretty url. In Yii2 if need pretty url I've to write rules for every action !!!
In Codeigniter you will get index.php/controller/action/parameter1/parameter2/parameter3 ie it does not expose action parameter variables, that too without writing any url rules!
===Edit===
pretty URL doesnt work for parameters if no rule is defined
below is my main.php
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [ '<controller:\w+>/<id:\d+>' => '<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
],
],
i am getting a lot of 404's, like
192.168.1.3/~user/urshow/frontend/web/movies/movies_all it would have work fine if it would be like this 192.168.1.3/~user/urshow/frontend/web/index.php?r=/movies/movies_all
Go to config.php and add
'components' => [
...
'urlManager' => [
'class' => 'yii\web\UrlManager',
'enablePrettyUrl' => true,
'showScriptName' => false,
],
...
],