resolve the request "api/orders".

Hi,

I wrote an api and now I am trying to change url but facing problem:

API is in a module "api" and controller name is also "api".

When i request api with url: localhost/project/api/api/orders/

This rule in my main works good:

array(‘api/api/view’, ‘pattern’=>‘api/api/<model:\w+>/<id:\d+>’, ‘verb’=>‘GET’)

I want to convert my api path to: localhost/project/api/orders/ (so that client can access via this url)

For this purpose when i use: array(‘api/api/view’, ‘pattern’=>‘api/api/<model:\w+>/<id:\d+>’, ‘verb’=>‘GET’)

It say 403, Unable to resolve the request "api/orders".

Please help

Just add an alias specific to that path.

‘rules’ => array(

            'api/orders' =&gt; '/api/api/orders')

When you call api/orders will actually call /api/api/orders.

Hope it helps.