English (United Kingdom)
Jms Multi Site, formerly joomla multisite.
Create, share multiple joomla sites in few clicks !
Message
  • EU e-Privacy Directive

    This website uses cookies to manage authentication, navigation, and other functions. By using our website, you agree that we can place these types of cookies on your device.

    View e-Privacy Directive Documents

Welcome, Guest
Please Login or Register.    Lost Password?
Go to bottomPage: 1
TOPIC: multisite_config and www
#2629
multisite_config and www 14 Years, 5 Months ago Karma: 0
I spent alot of time going through docs and tutorials. I want to set up a slave from an existing site. The slave shares users with the master. The issue Im running into is that if a user lands on the master site without the www in front then none of the logins work and user just sees a refresh of the page. I dont have anything in the multisite configuration that could be a problem like misspelling, I only have the slaves defined. Only the slave is defined with all the different aliases.

I have tried numerous deletes and saves and one time a completely different multistes_config.php was generated that worked the way I want and I cannot reproduce it.

Please tell me the difference in how these 2 multisites_config.php files are generated. I am unable to reproduce the second sample below which is the configuration that appears to work the way I want. I must be missing something in my understanding of how this all works.

This is a sample of the config in which the master does not work without the www.

Code:

<?php
if( !defined( '_EDWIN2WIN_' ) && !defined( '_JEXEC' )) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' ); 

if( !defined( 'MULTISITES_MASTER_ROOT_PATH' )) {
   define( 'MULTISITES_MASTER_ROOT_PATH', '/var/www/vhosts/master.com/httpdocs');
}

if( !defined( 'MULTISITES_MASTER_COOKIE_DOMAINS' )) {
   define( 'MULTISITES_MASTER_COOKIE_DOMAINS', '.www.master.com|www.slave.com|www.slave.com|slave.com|slave.com');
}

$md_hostalias = array( 'www.slave.com' => array( 
                            array( 'url' => 'https://www.slave.com', 'site_id' => 'slave', 'cookie_domains' => array( '.www.slave.com', 'www.master.com') ),
                            array( 'url' => 'http://www.slave.com', 'site_id' => 'slave', 'cookie_domains' => array( '.www.slave.com', 'www.master.com') )),
                       'slave.com' => array( 
                            array( 'url' => 'https://slave.com', 'site_id' => 'slave', 'cookie_domains' => array( '.slave.com', 'www.master.com') ),
                            array( 'url' => 'http://slave.com', 'site_id' => 'slave', 'cookie_domains' => array( '.slave.com', 'www.master.com') )));
?>



This is a sample of the config that does allow the master to work with or without www.

Code:

<?php
if( !defined( '_EDWIN2WIN_' ) && !defined( '_JEXEC' )) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' ); 

if( !defined( 'MULTISITES_MASTER_ROOT_PATH' )) {
   define( 'MULTISITES_MASTER_ROOT_PATH', '/var/www/vhosts/master.com/httpdocs');
}

$md_hostalias = array( 'www.slave.com' => array( 
                            array( 'url' => 'https://www.slave.com', 'site_id' => 'slave'),
                            array( 'url' => 'http://www.slave.com', 'site_id' => 'slave')),
                       'slave.com' => array( 
                            array( 'url' => 'https://slave.com', 'site_id' => 'slave'),
                            array( 'url' => 'http://slave.com', 'site_id' => 'slave')));
?>

jrachael
Fresh Boarder
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#2630
Re:multisite_config and www 14 Years, 5 Months ago Karma: 54
In your first config, it seems that you have shared the users and that you have manage your master website from "www.master.com"
Therefore the "www" is mandatory. If you had manage the master from "master.com" (without the "www" you would be able to have the www and without the www for the master.
The cookies generated would have been ".master.com" and not "master.com" (becarefull the dot in front of the url). In the current case, you can see ".www.master.com" that accept fake.www.domain.com or whatever in front of the "www" (because there is a dot).

In the second config, you have not shared anything.
So there is no "cookies" infos computed.
edwin2win
Moderator
Posts: 5370
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1
get the latest posts directly to your desktop
2Win, Multisite(s) are trademarks of Edwin2Win.
Joomla