News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Phil Sturgeon's Blog:
How to Multi-site CodeIgniter Set-up
June 24, 2009 @ 12:58:12

The CodeIgniter framework, by default, is set up to work with a one site instance. Unfortunately, this isn't always the case and several developers have found the need to make it support more than one website based on the same codebase. Phil Sturgeon has written up this post to show you exactly how.

A few people have asked me recently about setting up CodeIgniter to run accross multiple domains based on the same codebase. This can be handy for sites than run different databases for different geographical areas, all of which need the same code but different content. To get this working I took a little code from PyroCMS and modded a previous article "How to: Support multiple production environments in CodeIgniter" and found a relatively simple solution.

You'll need to modify a bit of code to get things working: changing up the config.php to look at the hostname, making a site constant and updating the database.php config file to configure connections for each of the site constant defined.

0 comments voice your opinion now!
tutorial multisite codeigniter


blog comments powered by Disqus

Similar Posts

Dagfinn Reiersol's Blog: Real programming with PHP 5.3 (part 4): A more realistic example

SitePoint: Build a Photo Gallery Using CakePHP and Flickr

Brandon Beasley's Blog: Codeigniter Vanity URLs

WaxJelly Blog: How to write a custom Smarty function in PHP

SitePoint.com: OAuth for PHP Twitter Apps, Part I


Community Events











Don't see your event here?
Let us know!


component hack opinion database unittest package series facebook hhvm install framework performance language podcast release security introduction symfony2 application composer

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework