Screen shot 2011-09-16 at 11.50.21 AM_0.png

The Domain project is a suite of modules for running a group of affiliated sites from one Drupal installation and a single shared database.

Overview

Domain lets you share users, content and configuration across a group of sites such as:

  • example.com
  • my.example.com
  • thisexample.com (any domain string works)
  • example.com:3000 (non-standard ports are treated as unique)
  • example.com/section/ (path prefix, 3.x and later)

By default, these sites share all tables in your Drupal installation. Each domain can then have its own content visibility, configuration overrides, theme and more.

Which version should I use?

Branch Drupal Status
4.x ^11.4 || ^12 Alpha, Drupal 12 support
3.1 (3.x branch) ^10.2 || ^11 Beta
3.0.x ^10.2 || ^11 Stable, recommended for production
2.0.x ^10.2 || ^11 Stable, feature complete, bug fixes only

New sites should start on 3.0.x, or on 4.x to prepare for Drupal 12.

Key features

Configuration overrides with Config Collections

Since 3.x, per-domain configuration overrides are stored in Drupal core's Config Collections system instead of a custom override system. This keeps Domain aligned with core's configuration management: overrides are exported, imported and deployed like any other configuration.

Path prefixes (experimental)

Since 3.x, several domains can share a single hostname and be told apart by the first segment of the URL path:

  • example.com/corporate/: a corporate division
  • example.com/retail/: a retail division
  • example.com/fr/: a French-language variant

This helps sites that cannot add new hostnames because of corporate firewalls, shared hosting or single-origin CDN constraints, or that simply prefer to keep affiliated sites under one domain.

Content access per domain

The Domain Access module uses Drupal's Node Access system to decide what content is available on each site in the network. Unlike other multi-domain solutions, it grants access based on the domain the user is currently viewing, not on a group or site the user belongs to.

Installation

Install with Composer, for example for the stable 3.0 line:

composer require 'drupal/domain:^3.0'

No core changes are required, but some settings must be edited in services.yml. See the README and the documentation for details.

Domain uses some advanced Drupal concepts and requires that you understand and control your site's DNS configuration.

Companion modules

Documentation

Credits

Thanks to everyone who has contributed code, reviews, tests, translations and support over the years.

History

Domain was created by Gurpartap Singh in November 2006. Original development was sponsored by Morris DigitalWorks with an assist from DZone.

Articles and talks from the Drupal 6 and 7 era:

Supporting organizations: 

Project information

Releases