I have created folder structure like below:

Main Drupal: www_d8multisite_com

Subsite1: www_d8multisite_com/sites/default/ms1
Subsite2: www_d8multisite_com/sites/default/ms2

And put the sites.php inside


and defined my multisite like below:

$sites['www.d8ms1.com'] = 'ms1';
$sites['www.d8ms1.com'] = 'ms2';

And put the settings.php in both subsite folders like below:

Subsite1: www_d8multisite_com/sites/default/ms1/settings.php
Subsite2: www_d8multisite_com/sites/default/ms2/settings.php

Then I setup my virtual host like below:

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot "H:/wamp/www/www_d8multisite_com"
    ServerName www.d8ms1.com
    ServerAlias www.d8ms1.com
    ErrorLog "logs/www.d8ms1.com.error.log"
    CustomLog "logs/www.d8ms1.com-access.log" common

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot "H:/wamp/www/www_d8multisite_com"
    ServerName www.d8ms2.com
    ServerAlias www.d8ms2.com
    ErrorLog "logs/www.d8ms2.com.error.log"
    CustomLog "logs/www.d8ms2.com-access.log" common

Still my multiste is not working. If I'm trying to access any of the subsites(www.d8ms1.com or www.d8ms2.com) it only pointing to base site. I mean site is still loading from base www_d8multisite_com. not from sub folders.

Am I doing something wrong in the configuration? or I missed any step?

  • <VirtualHost www.d8ms1.com:80>
    – user21641
    Jun 24 '17 at 3:37

I have never really used multi site much, but I have read the documentation multiple times nevertheless.

It always was my understanding that the default folder was reserved for the default site, and that all other folders should be placed next to it, not inside of it.

Next to that, the documentation implies that your folder name should match a certain pattern, based on the site url.

Instead of using www_d8multisite_com/sites/default/ms1 I'd try using www_d8multisite_com/sites/d8ms1.com instead.

  • 1
    Yes, domain folders should be in /sites and not /sites/default. The default folder is the one Drupal will use if no other match is found. For instance, if you only ran single site, you would use /sites/default.
    – Kevin
    Jun 25 '17 at 21:44

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.