3

Many, many years ago, before MSM, there was a documented way to have multiple sites run on a single installation of EE. It involved creating a new folder at the site root and having an index.php and path.php file that redirected to the main installation.

I used this successfully for many years on EE1.x. Now that I've upgraded to EE2.x, it seems to have broken.

The main installation is at: www.rickandlynne.com

And, the second site is my wife's site at: www.rickandlynne.com/lynne

The trouble I am now having is with pagination, logins, and other blind navigation from my wife's site that ends up redirected to my site. For example, try pagination from her site and you'll see there is a "/" missing in the URL.

I've been experimenting with settings in the index.php and path.php and channel configurations and just can't figure out how to make this work any more.

Does anyone have experience with this and know how to get this "old style" multiple site scheme working in EE2? It appears to be possible because in the EE2.x index.php file there is a section shown here (with my configuration from EE1.x_:


/*
 * --------------------------------------------------------------------
 *  CUSTOM CONFIG VALUES
 * --------------------------------------------------------------------
 *
 * The $assign_to_config array below will be passed dynamically to the
 * config class. This allows you to set custom config items or override
 * any default config values found in the config.php file.  This can
 * be handy as it permits you to share one application between more then
 * one front controller file, with each file containing different 
 * config values.
 *
 * Un-comment the $assign_to_config array below to use this feature
 *
 * NOTE: This feature can be used to run multiple EE "sites" using
 * the old style method.  Instead of individual variables you'll
 * set array indexes corresponding to them.
 *
 */
    $assign_to_config['template_group'] = 'lynne';
    $assign_to_config['template'] = 'index';
    $assign_to_config['site_index'] = 'go';
    $assign_to_config['site_404'] = '';
    $assign_to_config['global_vars'] = array(); // This array must be associative

  • I don't have an answer for you...but I did once try to get this working when I first tried moving one of my hobby-sites over to EE2. I eventually gave up and left it on EE1 for another few years. I remember that I had problems with pagination, too - but also with getting Site 2 to actually display. When I went to the EE support forums, no one offered any assistance other than "that method was officially not supported in EE1x, try the Community Corner forums." Hope someone has a solution for you!! – user800 Feb 5 '13 at 18:25
3

Yes it's possible. Assuming, you are still on the same server (since server variation can switch things up), not these things:

  1. Path.php is dead. We've kept ours around on clients we upgraded to EE2, but added the note:

    // THESE ITEMS ARE SET IN index.php and config.php AS OF EE2

  2. Check Your URI Protocol. This dogged us for awhile, before we happened upon it looking for a solution to a totally different issue. EE2 defaults to 'AUTO' for the protocol, which should work, but hasn't yet worked for us on any server where we are using the Old School MSM method. Test 'PATH_INFO' or the other methods. 'PATH_INFO' has been our go to. (This is config.php)

    $config['uri_protocol'] = "PATH_INFO";

  3. Pagination Sucks. Even on primary domains, it tries to re-insert the /index.php before processing the data. Your issue seems to be two-fold: (a) Your wife's domain isn't pointing, because you couldn't get it to work and (b) that missing trailing slash.

    Both of these maybe solved by getting the domains to work. But you may still need to do a little work. For one of our projects, we use FIND & REPLACE to clean-up the url. This is the clean url.

    http://consumerservicesguide.org/resources/national/browse/category/197/P25

This is what the system produces

http://consumerservicesguide.org/csg/resources/national/browse/category/197/P25

And this is the code we use to clean it up

{paginate}
<div id="pagination">
<p>{exp:low_replace find="{segment_1}/" replace=""}{pagination_links}{/exp:low_replace}</p>
</div>
{/paginate} 

Because of the use of custom segments, the index.php file isn't an issue, here, but has been on other sites. We test. If we manually remove the index.php and pagination still works, then we basically add index.php/{segment_1}/ to the find and replace script. If pagination doesn't work without the index.php, we leave it in. This seems to be server dependent.

Those are the main points, but you can also check my response here, if you need more troubleshooting tips. But my thoughts are, as long as you've transferred the details from 'path.php' to index.php, and adjusted the URI PROTOCOL in 'config.php', if it was working before, on the same server, it should work again.

|improve this answer|||||
  • Thank you for the extra-thorough response. Just got home (yes this is a hobby site so I struggle to pay for MSM) and I'll try your suggestions after dinner. Been a long day and I'm hungry. Priorities ;-) Will let you know. Thanks again! – Rick Robinson Feb 6 '13 at 0:06
  • BTW, I'm running on the ehclients servers, so I'd hope the standard setup of "AUTO" would work on their own servers. Tried changing to PATH_INFO and no luck so far. – Rick Robinson Feb 6 '13 at 2:10
0

@nonprofit_tech, here is where I am...

I edited the subsite index.php to look like this:

     $assign_to_config['site_name'] = 'lynne';
     $assign_to_config['site_url'] = 'http://www.rickandlynne.com/lynne';

     $assign_to_config['template_group'] = 'lynne';
     $assign_to_config['template'] = 'index';
     $assign_to_config['site_index'] = 'index.php';
     $assign_to_config['site_404'] = '';
     $assign_to_config['global_vars'] = array(); // This array must be associative

Changing the uri_protocol did not seem to make any difference.

These changes make everything work. Pagination works and login from the subsite returns the user to the home page of the subsite. So, you definitely pointed me in the right direction.'

The subsite URLs do look weird, something like:

http://www.rickandlynne.com/lynne/index.php/lynne/comments/doggie_snow_angel

for a comment page, with the extra "lynne/index.php" stuff there. But, at least the site works. (On my sub site, I've named index.php to be "go" so it looks less weird.) I did not need to use the low find/replace in the pagination code, but may find that useful as I continue to learn how this works.

I did not set up any global_vars for the subsite and exploring that might lead to further insight.

Anyway, thanks for pointing me in the right direction. My wife is now less upset about the disruption to her blog from the EE upgrade. Too bad the folks at EE (who were pmachine when I started using them) and who got their start from enthusiastic "hobbiest" supporters like me have abandoned support for hobbiests. As I recall, this all started as something of a hobby for Rick.

|improve this answer|||||
  • I'm confused. Your sub sites, don't have different domain names? The subsite method, old or new school, assumes that the domain name will change somehow, either something like: lynne.rickandlynne.com or lynne.com. Your set-up seems more just like sections of a regular site. There's no need to do any of this if you just want different sections like rickandlynne.com/rick and rickandlynne.com/lynne. Your possibly overcomplicating the set-up. – nonprofit_tech Feb 6 '13 at 6:35
  • No, same domain with separate root directories for each subsite. I did this because I wanted my wife's site to be at www.lynneandrick.com/lynne instead of www.lynneandrick.com/rick/go/lynne. I was not aware of the ability to use lynne.rickandlynne.com at the time (and am still not sure how that works). So, you are no doubt correct that I have overcomplicated it. I could even do a redirect from the desired home page url to the more complex one, I suppose. Worth a try on my offline test site. – Rick Robinson Feb 6 '13 at 12:27
  • I see. A brief overview. Technically, http://lynne.rickandlynne.comis considered a subdomain. Once you have a primary domain, you can ask your ISP to create the sub-domain and point it. This way you were a nonprofit, you could have: http://mydomain.org main site, then say http://staff.mydomain.org and http://volunteers.mydomain.org as subdomains. If you wanted multiple domains, then that would have been your original intent: http://rickandlynne.com being one, and http://lynneandrick.com being the other. The subsections lynne and rick after the domains are unnecessary. – nonprofit_tech Feb 6 '13 at 16:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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