• Overview
    Key features
    • Observability
    • Auto-scaling
    • Multiframework
    • Security
    Frameworks
    • Django
    • Next.js
    • Drupal
    • WordPress
    • Symfony
    • Magento
    • See all frameworks
    Languages
    • PHP
    • Python
    • Node.js
    • Ruby
    • Java
    • Go
  • Industries
    • Consumer Goods
    • Media/Entertainment
    • Higher Education
    • Government
    • Ecommerce
  • 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
  • Login
  • Request a demo
  • Free Trial
Meet Upsun. The new, self-service, fully managed PaaS, powered by Platform.sh.Try it now

How to manage Drupal 8 multi-site configuration

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. You can also take a look at our video on how to manage Drupal 8 multi-site configuration above.

Build your greatest app

Get started
Company
AboutSecurity and complianceTrust CenterCareersPressContact us
Thank you for subscribing!
  •  
Field required
Leader Winter 2023
System StatusPrivacyTerms of ServiceImpressumWCAG ComplianceAcceptable Use PolicyManage your cookie preferencesReport a security issue
© 2024 Platform.sh. All rights reserved.
Supported by Horizon 2020's SME Instrument - European Commission 🇪🇺