There is a link that is formed like this:

$app->urlManager->createUrl(['/actours/actour','slug'=>$actours->slug_name]) 

Here is the rule that route the link:

 'actours/<slug>'=>'actours/actour', 

It turns out this link:

 sites.lc/actours/Luk-Uilson 

But such a link is also being routed.

 sites.lc/actours/actour?id=1549 

How can I correctly write a rule so that the lower link does not fall under the rule?

  • Most likely, for the lower link you need to write a separate rule. - withoutname

1 answer 1

To disable default routing, specify the urlManager option in the parameters of the urlManager component:

 'components' => [ 'urlManager' => [ 'enableStrictParsing' => true,