Module Subdomain With Showscriptname=True

I have a customerPortal module and want to have cp.mydomain.local point to it. I have seen many threads explaining the URL rules to setup but none where showScriptName=true and this seems to be my issue.

My main application works just fine and visiting cp.mydomain.local goes to ‘cp.mydomain.local/index.php/dashboard/view’ which works as expected. However, the command


echo $this->createUrl('dashboard/view');

results in ‘cp.mydomain.com/dashboard/view’ which does not work. I could change all my createUrl calls to use


echo $this->createUrl('/dashboard/view');

however when a CGridView renders the paging links it does not include the index.php (I am assuming it uses createUrl).

From my config/main.php (I have dropped the http prefix due to forum restrictions):




'urlManager' => array(

  'urlFormat' => 'path',

  'rules' => array(         

    'cp.mydomain.local/' => 'customerPortal',

    'cp.mydomain.local/<controller:\w+>/<id:\d+>' => 'customerPortal/<controller>/view',

    'cp.mydomain.local/<controller:\w+>/<action:\w+>/<id:\d+>' => 'customerPortal/<controller>/<action>',

    'cp.mydomain.local/<controller:\w+>/<action:\w+>' => 'customerPortal/<controller>/<action>',

    '<controller:\w+>/<id:\d+>' => '<controller>/view',

    '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',

    '<controller:\w+>/<action:\w+>' => '<controller>/<action>',

  ),

)



Any ideas?