Kirby class urls option has no effect

hi. im currently trying to get a multi-site running which runs on the same content but has different front-ends.

i tried following this cookbook: Using Kirby for multiple sites | Kirby CMS

i modified it a bit so that the content and blueprints stays in the / directory and just the templates and config differ for the domains.

it works. but it doesnt load the assets (css, js, fonts). if i inspect the source it points to the home directory (/assets) and not the new subdirectory (/subpage.com/assets) with the asset folder.
i cant get this to run. it seems that the ‘urls’ argument of the kirby object in the index.php has no effect - already typed in nonsense and it doesnt throw errors.
is this cookbook still working in K4 ?

best,
elias

Could you please post your index.php and the folder structure?

code:

<?php
require 'kirby/bootstrap.php';

$sites = [
  'sitea.test' => 'sitea.com',
  'siteb.test' => 'siteb.com',
];

$host = Url::host();
$root = $sites[$host];
$url  = 'http://' . $host;

$kirby = new Kirby([
  'roots' => [
    'index'   => __DIR__,
    'site'    => 'site',
    'content' => 'content',
    'media'   => $root . '/media',
    'assets'  => $root . '/assets',
    'templates' => $root . '/templates',
    'config'  => $root . '/config',
  ],
  'urls' => [
    'media'  => $url . '/' . $root . '/media',
    'assets' => $url . '/' . $root . '/assets',
  ],
]);

echo $kirby->render();

folder structure:

  • /
    • content
    • site
    • sitea.com
      • assets
      • config
      • media
      • templates
    • siteb.com
      • assets
      • config
      • media
      • templates
    • index.php
    • kirby

this was connected to this behavior: Setting asset `urls` in index.php doesn't have any effect on asset links · Issue #2229 · getkirby/kirby · GitHub

works fine now