An example for the last one (based on the old multi tenant locale support forums):
config.php
<?php
$host = array_get($_SERVER, 'HTTP_HOST');
if (! file_exists("tenants/$host.php")) {
$host = "default";
}
return require "tenants/$host.php";
This assumes that in your Flarum root you have a directory tenants
where each hostname has it's own config and there's a default.php for your fallback:
config.php
tenants/
default.php
example.com.php
Please note you will run into some issues like:
- shared assets compilation
- cache handling
Which you'll need to take care of as well. For this reason it's wiser to create an extension. I've been working on one (for a pretty long time without any considerable progress) which might become a paid extension on the Flagrow extension marketplace at some point.