Yii Framework Forum: Module Subdomain With Showscriptname=True - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Module Subdomain With Showscriptname=True Rate Topic: -----

#1 User is offline   Bass28 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 27-March 14

Posted 28 March 2014 - 10:07 AM

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?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users