Yii Framework Forum: Subdomain and Modules - Yii Framework Forum

Jump to content

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

Subdomain and Modules Rate Topic: -----

#1 User is offline   micz 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 31
  • Joined: 05-June 09

Posted 11 February 2010 - 08:03 AM

I have question. Is it possible to assign subdomain to module? For example admin.domain.com to admin module.
0

#2 User is offline   Y!! 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 978
  • Joined: 18-June 09

Posted 11 February 2010 - 02:26 PM

There is a feature called "Parameterizing Hostnames" (described on this pages). You can do:

'components' => array(
   ...
   'urlManager' => array(
      'rules' => array(
         'http://admin.example.com' => 'admin/site/index',
         'http://admin.example.com/login' => 'admin/site/login',
      ),
   ),
   ...
),


So "admin/site/index" refers to the module "admin" with controller "site" and action "index".
1

#3 User is offline   Rituparna 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 17-August 11
  • Location:India

Posted 12 February 2012 - 02:59 PM

Hi I am Ritu from India, I am using YII framework at one of my project and I am facing problem with Parameterizing Host Names, I have a module "ADMIN" and I want to display this as a subdomain within my domain, so I am setting rules like the following way from the protected/config/main.php:
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'rules'=>array(
'<controller:w+>/<id:d+>'=>'<controller>/view',
'<controller:w+>/<action:w+>/<id:d+>'=>'<controller>/<action>',
'<controller:w+>/<action:w+>'=>'<controller>/<action>',
'www.admin.moresoccerfun.com/login' => 'admin/default/index',
),
),
But when I am running the page: www.admin.moresoccerfun.com/login from the browser, it is showing "SERVER NOT FOUND". Please help me out from this problem.
Thanks and looking for your response.
0

#4 User is offline   yiqing95 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 602
  • Joined: 27-December 10
  • Location:china

Posted 05 April 2012 - 10:43 AM

did you miss the 'http://' prefix ? :lol:
0

#5 User is offline   hojank 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 20-April 11

Posted 16 August 2012 - 06:09 AM

Hi I also experiencing the same thing. and not missing the http.

Please advice. Thanks :)
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