Preety url is not working for me

Hello

my web congiguration for url is




'urlManager' => [

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

            'enablePrettyUrl' => true,

            'showScriptName' => false,

            'rules' => [

                '<alias:\w+>' => 'site/<alias>',

            ],

        ],



but the url still looks messed up :




http://localhost/yii2/YES-%E2%80%8F%E2%80%8Fbasic-rbac-school/student/view?id=3




or




http://localhost/yii2/YES-%E2%80%8F%E2%80%8Fbasic-rbac-school/student/index



what am i doing wrong here?

What urls you want see?

the reason your url’s are messed up, is because your regex does does not match your routes


// the following route will only match words without any spaces or dashes 

'<alias:\w+>' => 'site/<alias>',


// try changing this to something like 

'<alias:[\w-]+>' => 'site/<alias>',