I was able to set different domain-based landing pages for existing nodes of our main site using the Domain module. This module is fairly complex and will either be exactly what you need, or not.
Our use case is that we have multiple one-page partner projects, such as campaigns, that need their own domain name but that share content from our regular website, such as our blogs.
The following are the steps taken for Drupal 7.
Be sure to read the entire readme file, the quick install and the install instructions before starting. There are many variables specific to your use case and environment.
Step 1
In order to use it, you will need to be able to configure the domains on the server to reference the primary website's docroot. In my case, that means I needed to point the domains over to the same server, and set up different vhost files as follows:
<VirtualHost *:80>
DocumentRoot "/var/www/html/example/docroot"
ServerName example2.com
</VirtualHost>
Step 2
You will then need to add some code to your sites/default/settings.php
. Make sure the path is correct, according to your set up.
/**
* Add the domain module setup routine.
*/
include DRUPAL_ROOT . '/sites/all/modules/contrib/domain/settings.inc';
Step 3
Once this is done, install the domain module and enable only the domain module, but none of the submodules yet. Then rebuild permissions (/admin/reports/status/rebuild
). Then enable the domain_conf
anddomain_settings
and any others. Once enabled, set your primary domain to default.

Step 4
Add your new domains by clicking on "Create domain"
Step 5
In order for the blog and other relative links to go back to the primary domain, I needed to set the following in advanced settings (Structure > Domains > Settings):
(Here, FosterClub is my primary domain).
After this, there are other sub-modules you can enable to further customize what you need to accomplish. Be sure to set your permissions. You are also able to assign domain access to specific roles and users, which allows them to edit and create content restricted to specific domains, using the "edit domain content" permission, with the domain_content
sub-module:
This is a screenshot of settings under a specific user.
