First, I'm using shared hosting. I've set up the DNS so I have one.example.com, two.example.com, etc. Each subdomain works properly, but they use the default page.tpl.php/look exactly the same as my front page. I'm assuming the next step is to configure the settings.php, web.config, and to create preprocessed theme hooks. Is there a good D7 tutorial on how to do all of this via "subdomains"?

Also, I'm planning on using the "Domain" module. I've got it properly configured. But, don't really see a point in using it until the above mentioned is setup properly.


Instructions for multisite installations are in sites/default/settings.php. To quote from that file:

For example, for a fictitious site installed at http://www.drupal.org/mysite/test/, the 'settings.php' is searched in the following directories:

  1. sites/www.drupal.org.mysite.test
  2. sites/drupal.org.mysite.test
  3. sites/org.mysite.test

  4. sites/www.drupal.org.mysite

  5. sites/drupal.org.mysite
  6. sites/org.mysite

  7. sites/www.drupal.org

  8. sites/drupal.org
  9. sites/org

  10. sites/default

If you are installing on a non-standard port number, prefix the hostname with that number. For example, http://www.drupal.org:8080/mysite/test/ could be loaded from sites/8080.www.drupal.org.mysite.test/.

The lookup can be changed as described in sites/example.sites.php:

This file allows you to define a set of aliases that map hostnames and pathnames to configuration directories. These aliases are loaded prior to scanning for directories, and they are exempt from the normal discovery rules. The aliases are defined in an associative array named $sites, which should look similar to the following:

$sites = array(
  'devexample.com' => 'example.com',
  'localhost.example' => 'example.com',

The above array will cause Drupal to look for a directory named "example.com" in the sites directory whenever a request comes from "example.com", "devexample.com", or "localhost/example".

BTW: multisite installations are usually done to facilitate using different databases.

| improve this answer | |

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.