Yii Framework Forum: Multiple Domains Url Management - Yii Framework Forum

Jump to content

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

Multiple Domains Url Management Rate Topic: -----

#1 User is offline   nguyendh 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 77
  • Joined: 21-March 11

Posted 29 March 2014 - 01:13 AM

Hi Guys,

I follow this wiki (http://www.yiiframew...onsecure-pages/) and it works great for one domain.

However, I have a .com and .ca domain pointing to the same code base. What do I do with the code below so that it works with both .com and .ca.

Yii::app()->createAbsoluteUrl('site/login')
* on .com domain gives https://example.com/site/login
* on .ca domain also gives https://example.com/site/login. I want it to return https://example.ca/site/login

return array(
    // ....
    'components' => array(
        'urlManager' => array(
            'class' => 'UrlManager',
            'urlFormat' => 'path',
            'hostInfo' => 'http://example.com',
            'secureHostInfo' => 'https://example.com',
            'secureRoutes' => array(
                'site/login',   // site/login action
                'site/signup',  // site/signup action
                'settings',     // all actions of SettingsController
            ),
        ),
    ),
);

I am new to Yii and this is my blog http://blog.michaelduy.com (deprecated hatadu.wordpress.com) about Yii, Git and PHP.
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