Hi
The panel won’t show on my multi-site setup. I get these error messages in the console:
Access to script at ‘http://localhost/media/localhost/panel/99a345cdf5e5dc02cf40bb11746da4ae/js/vendor.js’ from origin ‘http://localhost:9000’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
I created a multi-site setup using the cookbook Using Kirby for multiple sites | Kirby CMS
with Kirby version 3.6.2 and it runs locally via iOS PHP-Server.
Apart from the fact that the images are not properly routing yet, the setup works with this code:
<?php
require 'kirby/bootstrap.php';
$sites = [
'localhost' => 'localhost',
'subdomain-1' => 'subdomain-1',
'subdomain-2' => 'subdomain-2',
];
$host = Url::host();
$url = 'http://' . $host;
if (in_array($host, $sites) === false) {
die('Multi-Site not found');
}
$root = $sites[$host];
$kirby = new Kirby([
'roots' => [
'index' => __DIR__,
'site' => $root . '/site',
'content' => $root . '/content',
'media' => __DIR__ . '/media/' . $host,
'assets' => $root . '/assets',
'config' => $root . '/site/config'
],
'urls' => [
'media' => $url . '/media/' . $host,
'assets' => $url . '/' . $root . '/assets',
],
]);
echo $kirby->render();
The media folder is created automatically and looks like this:
What am i missing here?
Thank you in advance!