We are currently developing a website on Drupal 8.

This site will be in three versions. The differences between each site is minimal.

  1. Different logo
  2. Different colors CSS (HTML structure remains the same)
  3. Some content is filtered according to the domain name. For this, we created a selection field in the content type to know on which domain name the content appears (Site A, Site B, Site C).

What is the best way to manage this type of project with Drupal 8?

We are aware that this could cause problems with the Drupal cache if we do a simple detection via preprocess to load a particular CSS or content.


1 Answer 1


I am doing something very similar to migrate some D5, D6 and D7 sites to one D8 site. Currently I have this solution:

(1) Have one master domain that serves all content (i.e. proreos.de).

(2) Have some paths (routes) that serve special content for different domains (i.e. /asde/* -> serve content for anwalt-seiten.de/*)

(3) Have ThemeNegotiatiors (ThemeNegotiatorInterface) watching for that special routes to set the 'other' theme (like asde-theme).

(4) Have inverse proxies (apache2 mod_proxy) on the "other" domains that deliver the subcontent from the master domain (i.e. anwalt-seiten.de/index.html -> proreos.de/asde/index.html)

The advantage I hope to have from this approach:

(a) Have all data in one place (proreos)

(b) Have presentation separated from model (special themes)

(c) Have scalability (by inverse proxies).

But I don't have real experience cause I am still developing. Hope it helps anyway.

  • After searching a solution more "Drupal way", I think it's possible to handle this with ThemeNegociator Class for the CSS, and somes hook for filtering the content. I've read that Drupal's page cache take the whole absolute URL, so there is no risk of conflict.
    – Gaius
    Aug 12, 2016 at 8:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.