2

EE 2.7.2.

I have a secondary site on Multi Site Manager. Users can only login to EE from the main site, so I have no admin.php for the secondary site.

In the secondary site's index.php, I have:

 $assign_to_config['site_name']  = 'secondary_site_name';
 $assign_to_config['cp_url'] = 'http://primarysite.com/cp';
 $assign_to_config['site_url'] = 'http://secondarysite.com';

However, when I go to Admin --> General Configuration for the secondary site, URL to the root directory of your site is still set to primarysite.com

How do I make this setting correct? Note: I will be adding additional sites later.

2 Answers 2

1

EE CP don't use variables from index.php. Only from config's or from admin.php. Index.php is only effected on Frontend.

For other sites the system preference is keep in DB (exp_sites table). So you just need to change it for each site.

p.s. possible you setup your first site site_url in admin.php - you need to removed for your model.

1
  • To clarify - the CP is only accessible by logging in at the primary domain: domain.com/cp So there isn't an admin.php for each site. When I try to save different settings in system prefs (from the CP), they are overridden by my config.php.
    – 4midori
    Feb 17, 2014 at 17:19
0

Just out of interest, what problems exactly does this cause? I'm currently in the process of setting up an MSM build (actually upgrading it from an old EE1 installation) and your question made me notice that I have this happening too.

Are you using a config bootstrap (FocusLab Master Config)? If so you can 'fix' it by adding this to your config.master.php:

// --------------------------------------------
// RESET MSM SETTINGS IN A SHARED CONTROL PANEL
// --------------------------------------------

// are we in the control panel?
if (isset($_GET['D']) && $_GET['D'] == 'cp')
{
    switch ($_REQUEST['exp_cp_last_site_id']) {
        case '1' : $env_config['site_url'] = "http://site1.com/"; break;
        case '3' : $env_config['site_url'] = "http://site3.com/"; break;
        case '5' : $env_config['site_url'] = "http://site5.com/"; break;
    }
}

If you're not using a bootstrap, this should work in your main config.php file too, but change the $env_config to just $config instead. In each case you'll need to hardcode the site id and the site url.

7
  • I tried this, but changing the site_url now affects how add-ons like Wyvern access their supporting files. Primarily, I just wanted to get LiveLook to accept the right URL.
    – 4midori
    Jan 20, 2014 at 23:05
  • I would use symlinks if possible to point the secondary sites' theme folders at that of the main site. Jan 21, 2014 at 0:35
  • Unfortunately, that's not the best solution here. Is there another option?
    – 4midori
    Jan 21, 2014 at 22:03
  • What problems does your original question cause? Jan 21, 2014 at 22:17
  • The way I have settings now, everything works in the CP except Live Look (as far as I can tell). For example, when I'm working on site #2, my Wyvern and Assets fields all work properly. When I view source, I can see that Wyvern js and css files are loading from site1.com/path/to/files which is what I want. I supposed fixing LiveLook is the main concern right now.
    – 4midori
    Jan 22, 2014 at 3:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.