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.

Multisite in a shared environment

September 27, 2012 2:38pm

Subscribe [1]
  • #1 / Sep 27, 2012 2:38pm

    Neil Evans

    1403 posts

    After having quite a few customers want this - yet only have a very low level of traffic… I have started researching the options. Just about everyone seems to suggest a htaccess rule and above root folder… fair enough, but is the following feasible and acceptable in your EE minds?

    root index.php file… multi site section!!!

    if ($_SERVER[SERVER_NAME] == 'www.domain1.co.uk')
     {
      $assign_to_config['site_name']  = 'site1';
     }
     else if ($_SERVER[SERVER_NAME] == 'www.domain2.co.uk')
     {
      $assign_to_config['site_name']  = 'site2';
     }
     else
     {
      $assign_to_config['site_name']  = 'site3';
     }

    Clearly it need a lot more cleaning up and checking but you see the overall basic logic.
    If it is possible and plausible, what else would i need to consider here?

    Thanks, N

  • #2 / Sep 28, 2012 3:06am

    Kevin Smith

    4784 posts

    Hi nevsie,

    I certainly see where you’re headed here. Instead of using a single index.php file with a conditional like this though, why not just put the index.php file in each domain name’s web root, modified with the right $assign_to_config settings? That basic idea is what’s outlined here.

  • #3 / Sep 28, 2012 4:02am

    Neil Evans

    1403 posts

    Ah,  yes thats the bit i missed out!  Mainly because on lower end shared hosting the setup is a single public root,  with all domains pointed to that.  In most cases you cannot change that,  just fudge it with htaccess or potentially the option above if there is no reason why it might not work well!

  • #4 / Sep 28, 2012 3:22pm

    Dan Decker

    7338 posts

    Hi nevsie,

    It seems you agree with Kevin’s suggestion.

    Is there anything else I can assist you with?

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases