I am trying to create a sample multi-site drupal on my local machine. I use windows XP and XAMPP. For creating a multi-site i created a folder in /sites. Like /sites/example.com. After that I changed example.sites.php to sites.php and removed # from the line given below.
# $sites['localhost.example'] = 'example.com';

After that i tried to rum by typing localhost/example.com it is not installing to the new folder example.com but to default folder. My drupal 7 files are in htdocs I need help... Is there anything missing????


2 Answers 2


A multisite configuration is used when a web server is associated to different domain names, and you want the web site to appear different when accessed from different domains. (If you want the web site appears the same in both the domain, there isn't any special Drupal configuration to follow.)

Suppose that your web site answers to example.com, and example.org. You can have two different settings.php files:

  • sites/example.com/settings.php for example.com
  • sites/example.org/settings.php for example.org

In the case those files are not found, Drupal would use the default one (sites/default/settings.php).

The same can be done for subdomains.

On your Mac, you should edit your hosts file (/private/etc/hosts) to add something similar to the following one:

# Host Database
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
## localhost first.localhost second.localhost

In this case, the following files would be used:

  • sites/first.localhost/settings.php for first.localhost
  • sites/second.localhost/settings.php for second.localhost

If those files are not found, Drupal would look for the following ones (and other files as well):

  • sites/localhost/settings.php
  • sites/default/settings.php
  • Is an entry required in httpd-vhosts.conf for second.localhost & first.localhost ?
    – GoodSp33d
    Jul 24, 2012 at 11:06
  • That should be necessary if you want to change some Apache settings, such as ErrorLog, or CustomLog. You should not edit the file to change DocumentRoot, as you want the document root directory be the same.
    – apaderno
    Jul 24, 2012 at 11:17
  • Nice :) I see what you did there.
    – GoodSp33d
    Jul 24, 2012 at 11:34

you would wanna follow this link , everything is mentioned there with logic:


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.