Content and configuration information in a website using the Domain Access module is associated with specific domains. When a domain is not listed in the module's domains list configuration, the website uses the content and configuration of whatever domain is selected as the default
in the Drupal website.
When you are working in multiple environments, this can be an issue. The domains in each environment are different and the domain list is stored in the database. When a remote administrator, such as Acquia's Remote Administration team or a remote developer, pulls the production database with its list of production domains to the staging environment for testing, the stage domains may not display the expected results if the website in question is not using the default domain.
Adding the stage and development domains to the list is not a good solution either because the configuration would still be separate from the production domains and may not reflect an accurate picture when testing.
The best solution to this problem is to use the built-in Domain Alias submodule of the Domain Access module to define the development and staging domains as aliases of the equivalent production domains.
When this is configured, and the database from the production environment is pulled down to stage for testing, the website still reflects the same settings because it sees the stage domain as an alias of (not separate from) the defined production domain.
As an example, on Acquia Cloud, each environment is named slightly differently, so aliasing the various environments would help solve this problem. This arises because the customer hasn't added their *acquia-sites.com
domains as aliases. For example, a customer with website example.com
would need to add:
examplera.prod.acquia-sites.com
exampledev.prod.acquia-sites.com
examplestg.prod.acquia-sites.com
example.prod.acquia-sites.com
as aliases of example.com
in the Domain Alias settings for example.com
in order to prevent an issue.
Configuring domains on Acquia Cloud
For instructions on how to set up domains on Acquia Cloud, see the Managing your domains documentation.
Configuring domains on your server
To set up Domain Access aliases on the production server, complete the following steps:
- Sign in to your Drupal website as an administrative user.
- Install the Domain Access module.
- Enable the Domain Access and Domain Alias modules.
- On your domains list (
http://[site_URL]/admin/structure/domain
), click Edit Domain for the domain you are adding the alias to, and then click the Aliases tab. - Add the newly created subdomain as a new pattern without
http://
, but do not select the Redirect check box. Save the alias from production.