Extra slash in urlManager rules

33 views Asked by At

I'm trying to map services/v2/ to servicesV2.

I tried:

'services/v2' => 'servicesV2',

And I tried:

'services/v2/' => 'servicesV2/',

And:

'services/v2/<action:\w+>' => 'servicesV2/<action:\w+>',

And I got an error:

The system is unable to find the requested action "v2".

1

There are 1 answers

0
Renziito On

Did you put it on the begin of the array?

'rules'     => array(
                'services/v2'                            => 'servicesV2',
                '<controller:\w+>/<id:\d+>'              => '<controller>/view',
                '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
                '<controller:\w+>/<action:\w+>'          => '<controller>/<action>',
            ),