I
I
Ivan Komarov2022-01-12 11:47:35
Yii
Ivan Komarov, 2022-01-12 11:47:35

Why might routing not work in Yii2?

Will All explain this behavior of yii2?

Here is a snippet of the rules from the URLmanager settings:

'/kvartiry_novostroyki/' => 'novostroyki/index',
'/kvartiry_novostroyki/<building:\w+>' => 'novostroyki/index',
'/kvartiry_novostroyki/<building:\w+>/<flat:\w+>' => 'novostroyki/flat',
'/kvartiry_novostroyki/<building:\w+>/photoreports' => 'novostroyki/photoreports',
'/kvartiry_novostroyk/<building:\w+>/photoreports' => 'novostroyki/photoreports',


Everything works, except for the penultimate route.
It is not recognized and a 404 error comes out.
In this case, for example, the last route works.

Any ideas would be welcome as to why this might be?

To avoid unnecessary questions, here is the controller code:
public function actionPhotoreports() {
       echo 'test';
       exit;
}


Thank you.

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