0

Is it possible to only target specific MSM sites, as opposed to all sites.

I have two subdomains and a www site using the same MSM installation.

Is it possible to share a cookies between sub1.domain.co.uk and sub2.domain.co.uk but not affect www.domain.co.uk

Basically i want my members to be able to login to sub1 and automatically be logged in for sub2 domains but not www.

1 Answer 1

1

You can use the $assign_to_config array in each site's index.php and admin.php files to set some per-site config items. (See docs.)

But you might have better luck using a switch statement in your main config.php file, e.g.,

switch($_SERVER['SERVER_NAME'])
{
    case 'www.domain.co.uk':
        $config['foo'] = 'bar';
        break;
    case 'sub1.domain.co.uk':
        $config['foo'] = 'baz';
        break;
}

For sharing cookies, look at the $config['multi_login_sites'] variable, e.g.,

$config['multi_login_sites'] = 'http://sub1.domain.co.uk|http://sub2.domain.co.uk';
2
  • Hi Derek, $config['multi_login_sites'] caused me some problems, whenever i logged into sub1.domain it would redirect to sub2.domain or whichever site i put last when separated bye | << pipe. Have you experienced this before? Jul 29, 2015 at 23:24
  • Hmm, I have not. All that setting should do is affect how the cookies are set. Jul 30, 2015 at 12:20

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.