I use routing in Yii2. The task is that all pages of the form

/page-about /page-news /page-temp 

processed the controller's action. I tried to write like this:

 '/page-<pref:\w+>/' => 'main/static-page' 

but it does not work. The controller and the action in it is, but gives 404. Help make the correct routing

Closed due to the fact that off-topic participants Alexey Shimansky , user194374, Alex , Denis Bubnov , aleksandr barakin 22 Dec '16 at 19:57 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • "The question is caused by a problem that is no longer reproduced or typed . Although similar questions may be relevant on this site, solving this question is unlikely to help future visitors. You can usually avoid similar questions by writing and researching a minimum program to reproduce the problem before publishing the question. " - Alexey Shimansky, Community Spirit, Alex, Denis Bubnov, aleksandr barakin
If the question can be reformulated according to the rules set out in the certificate , edit it .

    1 answer 1

    As soon as I wrote the question, I immediately saw the error

     '/page-<pref:\w+>' => 'main/static-page' 

    There was an extra slash