Yii Framework Forum: Config Yii By Domain Name - Yii Framework Forum

Jump to content

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

Config Yii By Domain Name Config Yii by domain name Rate Topic: -----

#1 User is offline   Le Dem 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 30-July 14

Posted 30 July 2014 - 11:29 PM

Please help me! :mellow: (

I am would like to configure my website Yii by name domain.



note : I want to run on my website hosting but do not run on localhost

Thanks everybody.
0

#2 User is offline   jcagentzero 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 58
  • Joined: 14-October 11
  • Location:Philippines

Posted 31 July 2014 - 02:00 AM

View PostLe Dem, on 30 July 2014 - 11:29 PM, said:

Please help me! :mellow: (

I am would like to configure my website Yii by name domain.



note : I want to run on my website hosting but do not run on localhost

Thanks everybody.


What is the server of your web hosting? You only need to create the domain or sub domain name and point it to the Yii app directory.
Thank you and regards,

jcagentzero

http://www.jundycosmod.com

If you think this post is helpful, please don't hesitate to click + button.
0

#3 User is offline   PeRoChAk 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 579
  • Joined: 26-November 10
  • Location:Lahore, Pakistan

Posted 31 July 2014 - 03:08 AM

You can do this as in index.php file

$domain = $_SERVER['HTTP_HOST'];
// find the config file as
include 'protected/main/'.$domain.'.php';
Cheers
Perochak
Web Design - Logo Design - Application Development

My Blog | Forums Comparison
0

#4 User is offline   Le Dem 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 30-July 14

Posted 01 August 2014 - 12:01 AM

View PostPeRoChAk, on 31 July 2014 - 03:08 AM, said:

You can do this as in index.php file

$domain = $_SERVER['HTTP_HOST'];
// find the config file as
include 'protected/main/'.$domain.'.php';


I am would like to configure web of my only the running on hosting. when the different downloaded it back to the computer their, then trang web of me be can not run
0

#5 User is offline   Le Dem 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 30-July 14

Posted 01 August 2014 - 12:02 AM

View Postjcagentzero, on 31 July 2014 - 02:00 AM, said:

What is the server of your web hosting? You only need to create the domain or sub domain name and point it to the Yii app directory.


I am would like to configure web of my only the running on hosting. when the different downloaded it back to the computer their, then trang web of me be can not run
0

#6 User is offline   jcagentzero 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 58
  • Joined: 14-October 11
  • Location:Philippines

Posted 03 August 2014 - 08:16 PM

View PostLe Dem, on 01 August 2014 - 12:02 AM, said:

I am would like to configure web of my only the running on hosting. when the different downloaded it back to the computer their, then trang web of me be can not run


Hi, correct me if I am wrong, this issue isn't the configuration of Yii. But this is about your web hosting not working because it downloads php files. If this is web hosting, you need to enable php. If you can't, you need to find other web hosting that supports php.
Thank you and regards,

jcagentzero

http://www.jundycosmod.com

If you think this post is helpful, please don't hesitate to click + button.
0

#7 User is offline   PeRoChAk 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 579
  • Joined: 26-November 10
  • Location:Lahore, Pakistan

Posted 06 August 2014 - 06:46 AM

you need to do it as

if($_SERVER['HTTP_HOST']=='alloweddomain.com'){
// include the config
}else{
echo 'Invalid configuration';
}

Cheers
Perochak
Web Design - Logo Design - Application Development

My Blog | Forums Comparison
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