While the default method uses sites/default/settings.php for all sites, MEO also supports site-specific overrides. If a file exists at docroot/sites/<site-name>/settings.php, Drupal loads that file instead.
If you use this method, you must manually set the $AH_DRUPAL_SITE_NAME PHP variable before the require line.
For example, docroot/sites/site2/settings.php:
<?php
// Manually define the site name for the platform include.
$AH_DRUPAL_SITE_NAME = 'site2';
// ... (Your custom settings for site2)
// Load the MEO-managed platform settings.
if (file_exists('/var/www/site-php')) {
// You must use '-settings.common.inc'.
// The legacy '-settings.inc' naming convention is outdated and causes live site outages on MEO.
require '/var/www/site-php/' . $_ENV['AH_SITE_GROUP'] . '/' . $AH_DRUPAL_SITE_NAME . '-settings.inc';
}To set the configuration split status based on the Cloud Platform environment, add the following PHP code:
$site_name = $_ENV['AH_DRUPAL_SITE_NAME'] ?? '';
if (!empty($site_name)) {
// Assumes the split name matches the site name exactly.
$config['config_split.config_split.' . $site_name]['status'] = TRUE;
}To enable site-specific configuration splits, evaluate the AH_DRUPAL_SITE_NAME variable. Because multiple sites share the same codebase and environments, this step ensures that each instance loads only its designated features:
$domain = $_SERVER['HTTP_HOST'];
$site_configs = [
'site1' => 'site1',
'site2' => 'site2',
'site3' => 'site3',
];
$config_dir = 'default';
foreach ($site_configs as $identifier => $dir) {
if (strpos($domain, $identifier) !== FALSE) {
$config_dir = $dir;
break;
}
}
$settings['config_sync_directory'] = '../config/' . $config_dir;If this content did not answer your questions, try searching or contacting our support team for further assistance.
If this content did not answer your questions, try searching or contacting our support team for further assistance.