You can run multiple sites via the same Kirby setup. This can help you maintain your sites as you only need to keep a single setup updated.
To run multiple sites on a single Kirby installation, modify the
index.php at the root of your installation:
Let's walk through this step by step: First we load the
kirby/bootstrap.php script and define our sites in an array with the domain as the key and the file directory root as the value:
Then we use the
Url::host() method to retrieve the domain requested by the visitor and select the matching root for this one:
Finally, we use this information to create a
$kirby object with custom roots and a custom URLs and output
Even when running multiple sites through the same setup and code, you need a license for each of these sites: A single license is valid for a single Kirby installation, running on a single domain. If you add additional installations (i.e. under additional subdomains or subfolders) you need to purchase licenses for each of those installations.