Hello, dear community.
Today i have a specific problem: i’m trying to create the urlManager’s general rule for not-solved requests…
This is my urlManager configuration:
'urlManager'=>array(
'urlFormat'=>'path',
'urlSuffix'=>'/',
'showScriptName' => false,
'rules'=>array(
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
'/<url:.*>'=>'site/page',
),
)
This is my rule in the end of the list:
'/<url:.*>'=>'site/page'
and the SiteController’s action named actionPage:
public function actionPage($url)
{
echo $url;
}
The trouble is urlManager don’t recognize urls with 2 pieces divided by slash:
/dsa/asd/asdasd/ – [color="#008000"]OK[/color]
/asdasd/ – [color="#008000"]OK[/color]
/asd-asd/ – [color="#008000"]OK[/color]
/asd/asd/ – [color="#FF0000"]404[/color]
Can anyone explain me the reason of that?
I have no chance to use this rule like ‘/site/asd/asd/’ because i need clear urls in my project, like ‘/about/contacts/’ or just only ‘/contacts/’, and for those static pages i use a separate controller.
[UPDATE]
Hehe, i’ve found a probably solution while i write this post So, the problem is my two rules make a conflict… and the new question is – how to befriend them together?
I wonder, why the first rule is not skipped because there is no controller AsdController with actionAsd in it? O_o