• Overview
    Frameworks
    • Django
    • Next.js
    • Drupal
    • WordPress
    • Symfony
    • Magento
    • See all frameworks
    Features
    • Observability
    • Auto-scaling
    Solutions
    • Marketing Teams
    • Retail
    • Higher Education
  • Pricing
  • Featured articles
    • Switching to Platform.sh can help IT/DevOps organizations drive 219% ROI
    • Organizations, the ultimate way to manage your users and projects
  • Support
  • Docs
  • Contact
  • Login
  • Free Trial

How to manage Drupal 8 Multi-site

drupal

Notes

You can set up each site with a separate subdomain on Platform.sh quickly with only a few modifications to our Drupal 8 template. First, you can modify your routes.yaml file to assign a unique subdomain for each site. We're going to use the subdomains first and second for the two sites, and reuse those names throughout all of the following configuration steps. Notice how each subdomain is pointing at the same application, called app, as its upstream route. Next, you can give each site its own config/sync subdirectory, as well as settings in the sites subdirectory. To start off, each site's settings can be identical to those in default, but you can always customize them when you need to. Each subsite, first and second has its own database and endpoint, so we will give each of them a corresponding relationship in our .platform.app.yaml file. Each of those databases is defined for the same MariaDB instance in the project's services.yaml file. Notice that each database's relationship uses the service name db but then includes the unique endpoint defined for each of the two sites. Once we deploy the application, we can see that each subdomain contains its own separate Drupal 8 installation. We kept the subsite and endpoint names identical so that we could include some glue code that gets each installation to talk to the right database. While we did not cover that code in this demo, it's relatively simple, so be sure to check out our Drupal 8 Multisite template on GitHub for all of the details.

Build your greatest app

Get started
Company
AboutSecurity and complianceTrust CenterBoard and investorsCareersPressContact us
Leader Winter 2023
System StatusPrivacyTerms of ServiceImpressumWCAG ComplianceManage your cookie preferencesReport a security issue
© 2023 Platform.sh. All rights reserved.
Supported by Horizon 2020's SME Instrument - European Commission 🇪🇺