Let me lead with a quote from the present EE license. "An ExpressionEngine license purchase allows a single “live” installation in a production environment and ancillary “development use only” installations as needed to support the live installation (such as development and a staging servers). Additional installations require additional license purchases."

Further, even if you buy the Multi Site Manager add-on, the license requirement is that "License holder must be the owner of all Sites" -- and there is a long-enforced blanket legal disapproval of subletting an EE license or creating any kind of blogging service.

So, we are talking only about how to arrange multiple subdomains or sites when you don't need all the features of the Multiple Site Manager, but follow rules as if you licensed it. This is the pre-existing, or 'legacy' multiple site mode which is still in use, and was guaranteed by Ellis to continue to be present.

Some later code was discussed and repaired so that it did indeed remain available, and this mode is particularly convenient when all you need is some subdomains for development and testing, or for simple multi-presentation from a singly-owned site, as in some number of older EE1 sites which are still in use, and need to be maintained or simply upgraded.

I'm going to answer my own question here, as I spent the time to resurrect a development site using this mode today for someone. I consider it another instance of bringing out into this public resource the community knowledge we all contributed in over prior years.

1 Answer 1


These instructions lay out in brief the considerations for setting up a subdomain site in the form available at EngineHosting, where all domain accesses go to the main domain public_html. On other hosts which use DNS to assign subdomains, you won't need the additions to the main domain .htaccess.

  1. The EE install, where you have CP themes, etc., is at the root directory for web service: public_html. It is important that it stay there, because of a change Ellis made in EE that broke updating capability from subdirectories. However, you can freely move the system folder where you like, adjusting your index.php path. I have it above public_html, in the usual fashion.

  2. Here’s the htaccess scripting that I use to enable a subdomain on a subdirectory of public_html. YMMV, but this is straightforward, and again not needed if your host directly assigns subdomain directories.

    In root .htaccess, above your scripting for the EE install there, and below RewriteEngine On, goes the following. It accomplishes redirecting subdomain web requests so that they appear to be direct on the subdirectory:

    # add the www if toplevel.com only; tell the browser always to use it

    RewriteCond %{HTTP_HOST} ^(yoursite.*) [NC] 
    RewriteRule ^http://www\.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

    # pick off any subdomains to be handled in their own directory

    RewriteCond %{HTTP_HOST} ^subdomain.yoursite.com [NC]  
    RewriteCond %{REQUEST_FILENAME} !subdomain/ # allows image requests etc. to pass through 
    RewriteRule ^(.*)$ ae/$1 [L]
  3. In the subdomain’s subdirectory, you just put your standard .htaccess as if it were a top-level domain. In EE itself, be sure to check through the main level site’s CP path settings, just to make sure the installer was sensible. I find Deeploy Helper to be very helpful to assure such matters, besides its primary purpose.

  4. You can initialize the subdirectory EE by copying over your main level’s index.php, adminasyounameit.php, and anything like favico or images directories that you want to use on the subdomain. As an EE site, the subdomain is independent of the domain-level site.

  5. Here are the additions or changes I made to the results of such a copy:

In adminasyounameit.php, set your system path relative to the subdirectory:

$system_path = '../../de/system'; // for system in de folder above public_html

Now you can run admin normally from the subdomain website. There are probably tricks to get it to line up on the correct template group; haven’t bothered.

In index.php, also:

$system_path = '../../de/system'; // for system in de folder above public_html

This is what fundamentally enables your site

Now you want to set so correct template group is used for the subdomain. Must set initial template too, as created bugs here were resolved.

$assign_to_config['template'] = 'index';
$assign_to_config['template_group'] = 'subtemplategroup';

You likely want a separate 404 page for the subdomain; otherwise will get main domain’s

$assign_to_config['site_404'] = 'subtemplategroup/notfound';

The following form is handy if you do as I do, use global variables inside to site-specifically target generic templates to localize for many purposes

  = array("my_channel" => "subdomainchan", "my_template_group" => "subtemplategroup");

Set the site name so it shows correctly wherever defaulted

$assign_to_config['site_name'] = 'SubDomain Sitename’;

Let EE internals know where this subdomain is in the web url sense. This is crucial in having it emit items correctly which have paths auto-added, such as may be case for css, images, etc..

$assign_to_config['site_url'] = 'http://subdomain.yoursite.com/';

The CP theme will be handled automatically from what you config’d in the base EE install control panel, as the CP will be called just as if it were from the main site.

We are now just above ‘END OF USER CONFIGURABLE SETTINGS’ in index.php, and things should run on the subsite, once saving from here.

I hope this is quite readable if not perfectly formatted, after a bit of a fight with the StackExchange editor about indents vs. code blocks.

  • To be able to actually use the "site_name" and for it to work expressionengine.stackexchange.com/questions/1563/…
    – GDmac
    Commented Feb 14, 2013 at 9:56
  • Cheers, Adrian ;) -- GDmac, actually it just worked for me on latest 2.5.5, when bringing the example back up. That's a considerable bug report, under your original post. Hope what I've seen shows they've cleared it. But your note may be very important to someone implementing legacy multiple sites on less than ancient EE versions - thanks for posting it. Commented Feb 14, 2013 at 22:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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