7

I'm trying to setup a drupal 7 multisite using subfolders for example:

example.com/site1

example.com/site2

In my drupal sites folder I have sites1 and sites2 according to sites.php I should be able to set it up as the following:

$sites['example.com/site1'] = 'site1';
$sites['example.com/site2'] = 'site2';

However this doesn't work, I can definitely see a site at example.com but am unable to see any of the sites in the sub folder.

1
  • Do you really need to expose the subsites as directories? It is usually far better to setup a subdomain, such as site1.example.com
    – Letharion
    Commented May 25, 2012 at 16:46

1 Answer 1

6

If you want to do it this way then you have to symlink the folder to the root of the drupal install:

cd /var/www/drupal
ln -s . site1

Then within sites.php use the following:

$sites = array(
    "example.com.site1" => "site1",
);
3
  • Can you provide an example where you have "/subdirect" and "sitename.com", both being called site1 doesnt let us know what to do when you want diff path's and sites :)
    – WestieUK
    Commented Nov 9, 2012 at 15:17
  • Answered my own question. If you have /subdir and site.com then it would be create a sym link for subdir in drupal root, then in sites.php. $domain . '.subdir' => 'site.com' the / must be a . - very important and tripped me up before i found this!
    – WestieUK
    Commented Nov 9, 2012 at 15:45
  • PS! I think this question is answered quite good in the documentation on Drupal.org - see drupal.org/docs/7/multisite-drupal/multi-site-in-subdirectories
    – hansfn
    Commented Jan 27, 2017 at 7:44

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.