ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

multi_login_sites broken

September 22, 2011 9:15pm

Subscribe [2]
  • #1 / Sep 22, 2011 9:15pm

    Benjamin Riege

    12 posts

    Hello,

    we have an issue with $config[‘multi_login_sites’]. The bug report of my colleague can be found over here.

    Do you have an ideas?

    #16542

    Hi EE support,

    when trying to set up the Multi Login Sites feature according to the installation documentation I always get the error message:

    —-
    An Error Was Encountered
    The URI you submitted has disallowed characters.
    —-

    I exactly followed this docu: http://expressionengine.com/wiki/Multiple_Domain_Login/

    I could figure out that the error appears especially with this entry in the ‘config.php’:

    $config[‘multi_login_sites’] = “http://www.example.com/|http://www.example.com/de/|http://www.example.com/nl/”;

    When I reduce this line to the first entry only or just remove all pipes then the error does not appear and I can login to all sites separately.

    Thanks for your help in advance.

    Best regards,
      Heiko

    Thanks for your assistance,
    Benjamin

  • #2 / Sep 23, 2011 2:33pm

    Kevin Smith

    4784 posts

    Hi Benjamin,

    I’ve seen this before, and I believe it’s due to running your MSM install from subfolders rather than subdomains or separate domains entirely. Technically this wasn’t previously supported, but we were able to figure out the last missing piece to make it all work with another EE user last month. That change to the code will be in the next release of EE. But for now (and ONLY if you are comfortable working directly in EE’s core code), find line 93 of /system/expressionengine/core/EE_Config.php and change this:

    // Set the default_ini data, used by the sites feature
      $this->default_ini = $this->config;

    to this

    // Set the default_ini data, used by the sites feature
    $this->default_ini = $this->config;
    
    if ( ! defined('REQ') OR REQ != 'CP')
    {
        $this->default_ini = array_merge($this->default_ini, $assign_to_config);
    }

    Next, since you are running your MSM Sites as sub-folders of your main domain (as opposed to subdomains or separate domains entirely), you must additionally use a unique $assign_to_config[‘cookie_prefix’] variable in the index.php that sits in each of your Sites’ web roots:

    $assign_to_config['cookie_prefix'] = 'example';
    $assign_to_config['cookie_prefix'] = 'site2';

    ...and so on. Since each separate Site has the same base domain name, EE will set the same cookie for each Site without this config variable, effectively causing the browser to overwrite each cookie so only the last Site in the multi_login_sites array will have a valid cookie. (I’ve updated the wiki article you linked above to add this note.)

    I also want to check on your method for index.php removal. Based on the above, I’m assuming you’re removing index.php from your URLs. Are you using the officially supported method of removing index.php?

    Is everything working as expected now?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases