Good evening everyone. Please help information. Website on YII2, on the server only nginx, no Apache. I configured the nzhinks config, it seems like all the rules, but I use aliases (slug) on ​​the site and I just can't get the links into a normal form. If the usual links /site/catalog do not cause complaints, then /rig?alias=tip-dvigatelya-8nvd48 and even more so ?alias=tip-dvigatelya-8nvd48&page=2 do not give rest. The rules in urlmanager wrote different, nothing good happened. Thanks in advance for your help.

The construction of '<controller:\w+>/<action:\w+>/<alias>' => '<controller>/<action>' helped to bring the link to the form /category/index/nasosy/ . Can anyone tell me how to remove / hide /index from it?

  • Why it was impossible to immediately CNC do? - Alex78191
  • Can you give more details? - Patison

1 answer 1

You must use an entry in the urlManager form:

  '/category/<slug>' => '/category/index' 

in turn, in the controller: public function actionIndex($slug = null) and by the value of the $slug parameter, enter the category.