Domain Access

Component ID

99990

Component name

Domain Access

Component type

module

Maintenance status

Development status

Component security advisory coverage

covered

Downloads

272884

Component created

Component changed

Component body

Drupal 8 status

Alpha10 has been released. It should be considered a major upgrade. See the detailed release notes regarding the upgrade.

See https://github.com/agentrickard/domain for the most current work.

Overview

The Domain Access project is a suite of modules that provide tools for running a group of affiliated sites from one Drupal installation and a single shared database. The module allows you to share users, content, and configurations across a group of sites such as:

  • example.com
  • one.example.com
  • two.example.com
  • my.example.com
  • thisexample.com <-- can use any domain string
  • example.com:3000 <-- treats non-standard ports as unique

By default, these sites share all tables in your Drupal installation.

Installation

Drupal 7

Module installation requires edits to your site's settings.php file. See the online installation guide for details.

Drupal 8

No changes are requires to install the module, but certain configurations need to be edited in services.yml. See the README for details.

Technical background

The module uses Drupal's Node Access system to determine what content is available on each site in the network. Unlike other multi-domain modules for Drupal, the Domain Access module determines user access based on the active domain that the user is viewing, rather than which group or site the user belongs to. For more information about Node Access in Drupal, see http://api.drupal.org/api/group/node_access/7

This module uses some advanced Drupal concepts and requires that you understand and control your site's DNS configuration. See this case-study or this more recent Row Eleven Wine Co. post for more details about using Domain Access.

You can also watch video of the DrupalCON Paris session "Managing Multiple Sites with Domain Access" (from 2009).

If you are looking for a module to provide subdomains to users and groups and do not need to affiliate content, take a look at Subdomain.

Upgrading to Drupal 7

If you use Domain Access on Drupal 6, these steps are required for a smooth site upgrade.

For users of 6.x.1 or 5.x., See the Domain Access UPGRADE.txt for complete instructions for upgrading to 6.x.2 or 7.x.

7.x.2 branch

The 7.x.2 branch was designed to allow for a quick transition from Drupal 6 to Drupal 7. Support for the 7.x.2 branch has been discontinued.

Please read the upgrade instructions for users of 7.x.2 before updating the code to a 7.x.3 release.

Extension modules

The Domain Access module works by itself and needs no additional modules. Included in the download are these helper modules that extend the features of Domain Access.

Included in the Domain package for Drupal 6.x.2.0

  • Domain Alias 6.x.2 and higher only by bforchhammer. Allows you to specify subdomain aliases and domain name patterns for domain entries so that multiple hostnames are matched on a single domain entry.
  • Domain Configuration -- Allows you to change select system variables for each subdomain, such as offline status, footer message and default home page.
  • Domain Content -- Provides a content administration page for each subdomain, so that affiliate editors can administer content for their section of the site.
  • Domain Navigation -- Supplies a navigation block with three themes. Creates menu items for each subdomain, suitable for using as primary or secondary links.
  • Domain Path -- Enables custom path aliases per domain.
  • Domain Prefix -- Provides a user interface for enabling select database table prefixing for use with subdomains. The Drupal 5 version is not fully functional on pgSQL, but Drupal 6 version is.
  • Domain Settings -- Exposes domain-sensitive variable settings to most configuration forms. Requires Domain Conf.
  • Domain Source -- Allows editors to set a primary source domain when links are written to content from other domains.
  • Domain Strict -- Forces users to be members of domains in order to view content. This is a sample extension module that uses the API.
  • Domain Theme -- Allows separate themes, theme settings and colors for each subdomain.
  • Domain User -- Allows for the automatic creation of subdomains for registered users.
  • Domain Views by mrichar1 and nonsie -- Provides Views integration for Views 5.x.1 and 6.x.2 or higher.

Linked items are stand-alone modules in the Drupal 7 release.

Stand-alone Projects

To speed development of new features, I will be spinning certain aspects of the Domain Access suite into separate projects, starting after the stable 6.x.2.0 release.

Multilingual sites

If you use the contributed i18n module suite, you should use the Domain Variable module instead of the provided Domain Configuration and Domain Settings modules.

Contributed Modules

A number of modules have been contributed by other developers to extend the features of Domain Access.

Credits and examples

Development is sponsored by Palantir.net.

Original development was sponsored by Morris DigitalWorks with an assist from DZone.