urlManager URL issue

I’m using Yii 1.1.16 on a CentOS server with PHP and Apache/Mysql.

I have the following set in my main.php conf file:




...

'urlManager'=>array(

            'urlFormat'=>'path',

                       	'showScriptName'=>false,

                       	'caseSensitive'=>false,

            'rules'=>array(

                        'admin/<_c>'=>'<_c>/admin',

                        'admin/<_c>/page/<page:\d+>'=>'<_c>/admin',

                       	'admin/<_c>/<_a:(update|create)>/*'=>'<_c>/<_a>',

...



This is so that when I call the admin action for every controller the admin appears first in the URL. The admin action is a list of models, for example categories.

It all works fine, except the CLinkPager which I’m calling like this in the view:


<?php $this->widget('CLinkPager',array('pages'=>$pages)); ?>

This is how the $pages variable is built in the Conroller:


$criteria=new CDbCriteria; // critaria are empty for this scenario

$pages=new CPagination(Categories::model()->count($criteria));

$pages->pageSize=self::PAGE_SIZE;

$pages->applyLimit($criteria);

Now on every one of my controller admin lists, for example, the “CategoriesController”, the URL I’m on looks like this:

mydomain.com/admin/categories

but in the pagination the page links that are generated look like this:

mydomain.com/admin/categories/admin/page/2

shouldn’t it be

mydomain.com/admin/categories/page/2

??

What am I missing?