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. The Domain Prefix module allows for selective, dynamic table prefixing for advanced users.
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/6
See this case-study or this more recent Row Eleven Wine Co. post for more details about using Domain Access. This module uses some advanced Drupal concepts and requires that you understand and control your site's DNS configuration.
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.
Release status
Drupal 7
The 7.x.2 branch is now bugfix only. It is stable and supported.
7.x.3-dev is being developed in cvs HEAD. New features and API changes go here.
Drupal 6
The Drupal 6 version is supported but now in bugfix-only mode. New features go into Drupal 7 and may get backported.
Drupal 5
Use at your own risk. Stable but unsupported.
Upgrading
For users of 6.x.1 or 5.x., See UPGRADE.txt for complete instructions for upgrading to 6.x.2 or 7.x
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 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.
Contributed Modules
The following modules have been contributed by other developers to extend the features of Domain Access.
- Domain Locale by nonsie. Provides custom language sets per domain for Drupal sites using Domain Access and core Locale module.
- Domain Access Advanced by gordon. Enables multiple node access modules to work together by moving Domain Access rules into db_rewrite_sql() instead of using the node access API.
- Domain Actions by gordon. Provides integration for Domain Access to allow actions to be taken based upon the domain. Works with core actions and the Rules module.
- Domain Blocks by nonsie. Enables domain specific visibility settings for blocks, eliminating the need to prefix the blocks table. [Drupal 6 only]
- Domain Geolocalization by jhedstrom. Allows domains to have associated locative information. When combined with the Domain User Default module, this module uses the Google Maps API to geocode users zipcodes for domain proximity searches.
- Domain GMap by jk@arsum.com. Multi-domain support for GMap module.
- Domain Login Restrict by jk@arsum.com. Restricts user login by domain affiliation.
- Domain Menu by canen. Allows each subdomain to use separate primary and secondary links. This feature is native to 6.x.2.0.
- Domain Node Type by Pasqualle and zserno. Gives privileged users the ability to set default domains for content types.
- Domain Nodequeue Tab by awolfey. Provides each node with a tab where users can assign that node to a domain-specific queue.
- Domain Relationships by nonsie. Adds relationships/grouping capability for domains.
- Domain Taxonomy by xanderz. Extends Domain Access functionality to taxonomy objects, by filtering terms by their assigned domain.
- Domain Toggle by falcon. Introduces open and private domains. In private domains users are forced to be assigned to a domain in order to view content on that domain. In open domains everyone can view the content. Replaces Domain Strict for some use-cases.
- Domain User Default by jhedstrom. Provides methods for users (and unauthenticated site visitors using the Session API module) to select a default domain. A version of this feature has been added to 6.x.2.0.
- Domain XML Sitemap by Dave Reid. Provides domain-specific sitemaps.
- User Import Domain Access by Agileware. Allows users to be assigned domains when using the user import module.
- Ubercart Domain Access by longwave. This module provides a basic integration of Domain Access for Ubercart, allowing an Ubercart store to span multiple domains, storing the originating domain when an order is made and displaying the correct store information on invoices. [Requires use of Domain Configuration module.]
Credits and examples
Development is sponsored by Palantir.net.
Original development was sponsored by Morris DigitalWorks with an assist from DZone.
Developer's API (Drupal 6) is online at http://api.therickards.com/api/domain