How to make friends urlManager with the rules in the config:
'urlManager' => [ 'class' => 'yii\web\UrlManager', 'enablePrettyUrl' => true, 'showScriptName' => false, 'enableStrictParsing' => true, 'rules' => [ '/' => 'site/index', '/admin' => 'admin/default/index', '<action>'=>'site/<action>', '<controller:\w+>/<id:\d+>' => '<controller>/view', '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>', '<controller:\w+>/<action:\w+>' => '<controller>/<action>', '<module:\w+>/<controller:\w+>/<action:\w+>/<id:\d+>' => '<module>/<controller>/<action>', '<module:\w+>/<controller:\w+>/<action:\w+>' => '<module>/<controller>/<action>', '<module:\w+>/<controller:\w+>' => '<module>/<controller>/index', ], ], with the rules described in the module (in this case, the module Yii2-user is given)
/** @var array The rules to be used in URL management. */ public $urlRules = [ '<id:\d+>' => 'profile/show', '<action:(login|logout)>' => 'security/<action>', '<action:(register|resend)>' => 'registration/<action>', 'confirm/<id:\d+>/<code:\w+>' => 'registration/confirm', 'forgot' => 'recovery/request', 'recover/<id:\d+>/<code:\w+>' => 'recovery/reset', 'settings/<action:\w+>' => 'settings/<action>' ];