Welcome Guest, Not a member yet? Register   Sign In
multiple sites, 1 codebase, using symlinks (with smarty)
#8

[eluser]E1M2[/eluser]
SOLVED

The setup for multi sites using 1 codebase and symlinks works as is on the live server. I have my sub domains (cms.domain.com, id.domain.com) mirrored to the main domain.com. No files are being copied here it's directly linked.

CHANGES IN INDEX.PHP (REMOTE SERVER - DOMAIN.COM)

Code:
// System folder var
$system_folder = "system_1.5.4";


// Application folder var
$myApp = '';

switch($_SERVER['HTTP_POST'])
{
    case 'cms.domain.com':
        $myApp = 'www_cms';
        break;

    case 'id.domain.com':
        $myApp = 'www_id';
        break;

    default:
        $myApp = 'application';
    }
    
$application_folder = $myApp;


// Application Constants
//Commented out the whole if(is_dir($application_folder)) biz and changed the APPPATH so I have just have the following:

define('EXT', '.'.pathinfo(__FILE__, PATHINFO_EXTENSION));
define('FCPATH', __FILE__);
define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
define('BASEPATH', $system_folder.'/');
define('APPPATH', realpath($application_folder).'/');



FOR LOCAL SERVER
Had problems due to my use of the REQUEST_URI in order to do a switch for my $application_var locally. My work around for this is simple (...maybe not the best).

Instead of depending on '/htdocs/webapp/' (http://192.168.0.3/webapp/) index.php file
to filter out the REQUEST_URI and switch the application_folder var. I placed separate index.php files in '/htdocs/webapp/www_cms' and '/htdocs/webapp/www_id'. Instead of trying to access by pointing the brower to http://192.168.0.3/webapp/cms etc., I now access them directly (http://192.168.0.3/webapp/www_cms -OR- http://192.168.0.3/webapp/www_id)

LOCAL INDEX.PHP USED

Code:
// System folder var
$system_folder = "../system_1.5.4";

// Application folder var
$application_folder = '../www_cms'; -OR- $application_folder = '../www_id';

// Application constant
define('APPPATH', realpath($application_folder).'/');


Messages In This Thread
multiple sites, 1 codebase, using symlinks (with smarty) - by El Forum - 10-24-2007, 11:05 AM



Theme © iAndrew 2016 - Forum software by © MyBB