URL rule - match slash (/)

Is it possible to match an unlimited number of slashes with a rule? Like if I request:

/something/category/sub/subsub

And have this URL rule:




'something/<slug>' => 'category/show',



And controller code:




public function actionShow( $slug ) {

    echo $slug; // would return category/sub/subsub

}



Thanks in advance

Is this not possible?

how about:

‘something/<slug:(.*)>$’ => ‘category/show’,

1 Like

I just stumbled upon this thread searching for how to catch anything in a URL besides forward slash.

In short, this should catch anything, including slashes. Beware…:




'myModule/<slug:.+>' => 'myModule/someModel/view',



You very help me! Pattern slug:(.*) works for me