Multiple FuelCMS installations, one database
Hello,
is it currently possible to use a single database with multiple FuelCMS installations on a server? I am developing two webites at the moment, and want to house them both under my domain. The thing is, they both use tables like fuel_users and the like.
Is there any way to separate these? I tried setting the dbprefix property in the database.php file, but with a table like "advertisements", setting a prefix "abc_", it seems to display an error, searching for BOTH "advertisements" and "abc_advertisements"! Really weird.
Is there something I'm missing, or is FuelCMS/CodeIgniter just not suitable in this kind of scenario?
Martin
Comments
switch ($_SERVER['SERVER_NAME']) { case 'mydomain1.com': // The FUEL specific database tables $config['tables'] = array( 'fuel_archives' => 'fuel_archives', 'fuel_blocks' => 'fuel_blocks', 'fuel_categories' => 'fuel_categories', 'fuel_logs' => 'fuel_logs', 'fuel_navigation' => 'fuel_navigation', 'fuel_navigation_groups' => 'fuel_navigation_groups', 'fuel_pages' => 'fuel_pages', 'fuel_pagevars' => 'fuel_page_variables', 'fuel_permissions' => 'fuel_permissions', 'fuel_relationships' => 'fuel_relationships', 'fuel_settings' => 'fuel_settings', 'fuel_tags' => 'fuel_tags', 'fuel_users' => 'fuel_users' ); break; case 'mydomain2.com': // The FUEL specific database tables $config['tables'] = array( 'fuel_archives' => 'fuel_archives2', 'fuel_blocks' => 'fuel_blocks2', 'fuel_categories' => 'fuel_categories2', 'fuel_logs' => 'fuel_logs2', 'fuel_navigation' => 'fuel_navigation2', 'fuel_navigation_groups' => 'fuel_navigation_groups2', 'fuel_pages' => 'fuel_pages2', 'fuel_pagevars' => 'fuel_page_variables2', 'fuel_permissions' => 'fuel_permissions2', 'fuel_relationships' => 'fuel_relationships2', 'fuel_settings' => 'fuel_settings2', 'fuel_tags' => 'fuel_tags2', 'fuel_users' => 'fuel_users2' ); break;}
Thanks for this, but I have a question what about the database? will the setting still remains? meaning that for all sites they will maintain one database, just the switch that tells which of the tables that is being called. Thanks
Thanks works like charm to me too. Appreciate. Again it is not possible to have one installation running multiple sites?
Due to the customization of code in the fuel/application directory per website, it's not setup handle multiple sites. You may be able to make some configuration changes in the index.php file to point to different fuel/application directories based on a parameter (e.g. server domain).