Create Pretty Url in Yii2 Console


Please help me. I’m dealing with the problem of creating the pretty url in console app.

Here is my config in console.php :

'urlManager' => [

        'enablePrettyUrl' => true,

        'scriptUrl' => '',

        'rules' => [

            'api/unsubscribe/<param:\w+>' => 'api/web/unsubscribe'



But when I tried to create a pretty url in console using this line of code



        'param' => base64_encode(serialize($params))


It creates a url like

Any solutions to create a url like

That’s because you have = signs (%3D%3D) in your hash so it doesn’t match \w+