• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
multi domain in codeigniter

#1
[eluser]mom_maj[/eluser]
Hi all
I write application in codeigniter and i need to run that application in multi domain.

Cane i do that and if i can how ?

Regards.

Thanks for your help.

#2
[eluser]Phil Sturgeon[/eluser]
If you are hosting multiple domains on the same server and you have root access to the file system (or simply write permissions to those directories) then you can put codeigniter anywhere you like.

On as *nix based machine, i'd reccomend renaming systems folder to codeigniter and putting it as below:

Quote:/usr/local/codeigniter (this is the system folder)

/usr/<path to your account)/public_html (this is your application folder)

/usr/<path to your account)/public_html/index.php
/usr/<path to your account)/public_html/config
/usr/<path to your account)/public_html/controllers
/usr/<path to your account)/public_html/models
... etc.

Then just put those paths into your index.php file. 1 index file, one controllers folder, one config fodler, etc for each domain.

#3
[eluser]mom_maj[/eluser]
thank you for your reply but i need the same application (1-all controller 2-all models 3-all views 4-one config 5- same DB) run for all domain as one.

thanks.

#4
[eluser]mihailt[/eluser]
http://codeigniter.com/wiki/Automatic_base_url/

#5
[eluser]Phil Sturgeon[/eluser]
In that case its even easier.

Code:
$config['base_url'] = 'http://'.$_SERVER['SERVER_NAME'].'/';

Then just park your other domains on a main one using cPanel or whichever server management tool you use.

#6
[eluser]mihailt[/eluser]
just don't forget to modify cookie domain as well

#7
[eluser]mom_maj[/eluser]
it's work
thank you for replay

#8
[eluser]RaZoR LeGaCy[/eluser]
If you use APC on the server, does it still opcode?


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.