A
A
Alexander Verbitsky2019-04-19 03:04:22
Yii
Alexander Verbitsky, 2019-04-19 03:04:22

YII2. Why does cnc work clumsily?

Set up the CNC:

'rules' => [
        [
            'class' => 'yii\web\GroupUrlRule',
            'routePrefix' => 'category',
            'rules' => [
                'category-<alias:\w+>' => 'view',
            ],
        ],
]

for example alias = kurtki
If you go to the address
https://mysite.ru/category-kurtki
, then everything is correct, as well as at the address,
https://mysite.ru/category/view?alias=kostymi
because they are essentially identical.
but if alias = kostymi
works only through
https://mysite.ru/category/view?alias=kostymi
and if you go to the address,
https://mysite.ru/category-kostymi
it doesn’t work ....
Moreover, there are only 2-3 such pages, and a bunch of others work correctly.
And I can't figure out why...

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question