I'm starting with Drupal and I would like to have one instance of Drupal on my dev plateform with each project in a subfolder:

  • I don't want to have to change my host (and my customers hosts)
  • I need to keep drupal in a subfolder on my domaine (mydomain.tld/drupal)

Every website should be accessible like this :

  • mydomain.tld/drupal/customer1.com
  • mydomain.tld/drupal/customer2.org

I know that I have to add some configuration in sites/sites.php and I tryed:

$sites = array(

    'mydomain.tld.drupal.customX.com' => 'customerX.com'


But it looks like the rule is not used and I have a not found error...

Could you help me with that?

  • What version of Drupal are you using?
    – Clive
    Oct 26 '12 at 13:33
  • I'm using Drupal 7 Oct 26 '12 at 13:37
  • @MARTINDamien Is this dev platform in your local machine or is it hosted ? If hosted do you have a limit on number of subdomains for your site.
    – GoodSp33d
    Oct 26 '12 at 13:51
  • I currently work on my desktop so, I use localhost, but I wish to avoid manipulations on hosts files because I will move this drupal to a dev server and I will need to send the links to customers (and I'm not sure they will be able to modify it). On production servers I will have no limitations. Oct 26 '12 at 14:03
  • Ok if you dont have limitations you could use customer1.mydomain.tld which will be easier to configure.
    – GoodSp33d
    Oct 26 '12 at 14:10

You need to create subfolders like this:




and park domains site1.com , site2.net , site3.org to folder yourdomain.com/drupal/

  • 1
    For http://localhost/drupal/customer I have to add $sites['localhost.drupal.customer'] = 'customer'; and I have to create <DRUPAL ROOT>/sites/customer with a settings.php in it with DB connection informations. Is that right ? Oct 26 '12 at 14:01

I don't think you need the "$sites = array" part. I know it says it in the comments, but I just list them in the sites.php file:

$sites['mydomain.net'] = 'mydomain.net';

$sites['otherdomain.net'] = 'otherdomain.net';

$sites['thirddomain.net'] = 'thirddomain.net';

And don't forget the folders like Boris mentioned.

  • Both of those methods are identical as far as PHP is concerned
    – Clive
    Oct 26 '12 at 14:34

It's really tricky to get this working correctly but the documentation is already on Drupal.org - http://drupal.org/documentation/install/multi-site check the Subdirectory multi-site section. I've also posted a more concise version here which is more to specific needs.

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.