Hi,
I am developing have a multi-site setup with Kirby 3, for three sites that share the same codebase but have different content. I’ll call them “site1”, “site2” and “site3”.
After updating from Kirby 3.1.3 to Kirby 3.2.3, the panel has stopped working.
I have cleared the cache (Kirby’s and my browser’s), deleted all files under the sessions folder and the media folder, but the error persists.
I think there is something wrong with the way I have configured the paths on my index.php file, but I cannot figure out what is wrong.
The panel is showing a blank screen, and my browser’s console shows this messages:
The script from “http://site1.localhost/media/panel/070afde0274dc6039a8a8949d12a15cd/js/plugins.js” was loaded even though its MIME type (“text/html”) is not a valid JavaScript MIME type.
The script from “http://site1.localhost/media/panel/070afde0274dc6039a8a8949d12a15cd/js/app.js” was loaded even though its MIME type (“text/html”) is not a valid JavaScript MIME type.
Loading failed for the <script> with source “http://site1.localhost/media/panel/070afde0274dc6039a8a8949d12a15cd/js/app.js”. panel:442:1
Loading failed for the <script> with source “http://site1.localhost/media/panel/070afde0274dc6039a8a8949d12a15cd/js/plugins.js”. panel:439:1
The script from “http://site1.localhost/media/panel/070afde0274dc6039a8a8949d12a15cd/js/vendor.js” was loaded even though its MIME type (“text/html”) is not a valid JavaScript MIME type.
Loading failed for the <script> with source “http://site1.localhost/media/panel/070afde0274dc6039a8a8949d12a15cd/js/vendor.js”. panel:440:1
TypeError: panel.plugin is not a function (index.js:1:84638)
This is what my index.php file looks like, this was working fine with 3.1.3:
<?php
require __DIR__ . '/kirby/bootstrap.php';
$sites = [
'site1.localhost' => __DIR__ . '/site1',
'site1-staging.domain.com' => __DIR__ . '/site1',
'site1.com' => __DIR__ . '/site1',
'site2.localhost' => __DIR__ . '/site2',
'site2-staging.domain.com' => __DIR__ . '/site2',
'site2.com' => __DIR__ . '/site2',
'site3.localhost' => __DIR__ . '/site3',
'site3-staging.domain.com' => __DIR__ . '/site3',
'site3.com' => __DIR__ . '/site3',
];
$url = Url::host();
if($url == "localhost") {
$subdomain = array_shift((explode('.', $_SERVER['HTTP_HOST'])));
$url = $subdomain . '.' . $url;
}
$root = $sites[$url];
$kirby = new Kirby([
'roots' => [
'index' => __DIR__,
'content' => $root . '/content',
'media' => $root . '/media'
]
]);
echo $kirby->render();
I’d be very grateful for any hints on what’s wrong with my setup.
Thank you,
Laura