- Move pages/{fqdn}/pages/* to pages/{fqdn}/*
- Update setup.php to look at /user/pages/{hostname}
- Prepare for Git Sync to sync pages/ to user/pages/
57 lines
2.1 KiB
PHP
57 lines
2.1 KiB
PHP
<?php
|
|
/**
|
|
* Grav Multi-Site Setup Configuration
|
|
* Maps hostnames to environment-specific directories
|
|
* Only overrides 'page' stream to serve environment-specific content
|
|
*/
|
|
|
|
$hostname = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost';
|
|
$hostname = preg_replace('/:\d+$/', '', $hostname);
|
|
$hostname = strtolower($hostname);
|
|
|
|
$hostMap = [
|
|
'charters.turnsys.com' => 'charters.turnsys.com',
|
|
'plan.afabn.org' => 'plan.afabn.org',
|
|
'plan.ap4ap.org' => 'plan.ap4ap.org',
|
|
'plan.ezeda.org' => 'plan.ezeda.org',
|
|
'plan.ezpodstack.org' => 'plan.ezpodstack.org',
|
|
'plan.hfnoc.net' => 'plan.hfnoc.net',
|
|
'plan.knownelement.com' => 'plan.knownelement.com',
|
|
'plan.meetmorse.com' => 'plan.meetmorse.com',
|
|
'plan.merchantsofhope.org' => 'plan.merchantsofhope.org',
|
|
'plan.rackrental.net' => 'plan.rackrental.net',
|
|
'plan.redwfo.com' => 'plan.redwfo.com',
|
|
'plan.rwscp.net' => 'plan.rwscp.net',
|
|
'plan.sidedoorgroup.org' => 'plan.sidedoorgroup.org',
|
|
'plan.sol-calc.com' => 'plan.sol-calc.com',
|
|
'plan.suborbital-systems.com' => 'plan.suborbital-systems.com',
|
|
'plan.teamrental.net' => 'plan.teamrental.net',
|
|
'plan.thecampustradingcompany.com' => 'plan.thecampustradingcompany.com',
|
|
'plan.thepeernet.com' => 'plan.thepeernet.com',
|
|
'plan.turnsys.com' => 'plan.turnsys.com',
|
|
'plan.yourdreamnamehere.com' => 'plan.yourdreamnamehere.com',
|
|
'plan.startinglineproductions.com' => 'plan.startinglineproductions.com',
|
|
'staticsites.turnsys.com' => 'staticsites.turnsys.com',
|
|
];
|
|
|
|
$environment = isset($hostMap[$hostname]) ? $hostMap[$hostname] : 'staticsites.turnsys.com';
|
|
$envPath = GRAV_ROOT . '/user/pages/' . $environment;
|
|
|
|
if (!is_dir($envPath)) {
|
|
$envPath = GRAV_ROOT . '/user/pages/staticsites.turnsys.com';
|
|
}
|
|
|
|
// Only override page stream - use environment pages, fallback to default
|
|
return [
|
|
'streams' => [
|
|
'schemes' => [
|
|
'page' => [
|
|
'type' => 'ReadOnlyStream',
|
|
'prefixes' => [
|
|
'' => [$envPath, 'user://pages'],
|
|
],
|
|
],
|
|
],
|
|
],
|
|
];
|