# Multi-Page setup and issues with panel

**URL:** <https://forum.getkirby.com/t/multi-page-setup-and-issues-with-panel/15451>\
**Category:** Questions\
**Tags:** v3\
**Created:** [August 30, 2019, 3:52pm UTC](https://forum.getkirby.com/t/multi-page-setup-and-issues-with-panel/15451 "2019-08-30T15:52:08Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![baltasar](https://avatars.discourse-cdn.com/v4/letter/b/3d9bf3/32.png) [@baltasar](https://forum.getkirby.com/u/baltasar)\
**Post date:** [August 30, 2019, 3:52pm UTC](https://forum.getkirby.com/t/multi-page-setup-and-issues-with-panel/15451/1 "2019-08-30T15:52:09Z")

</div>

For sanity’s sake, I’m trying to implement my kirby site with an (internal only) “staging” part and a public website, which I started on plainkit, 3.2.2 and meanwhile upgraded to 3.2.3. My path is based on what I’ve read here, primarily: [https://getkirby.com/docs/cookbook/setup/multisite](https://getkirby.com/docs/cookbook/setup/multisite)

I have added two directories to which index.php points to fl-staging or fl-prod respectively:

```
<?php

require 'kirby/bootstrap.php';

$sites = [
  'example.com' => __DIR__. '/fl-prod',
  'www.example.com' => __DIR__. '/fl-prod',
  'staging.example.com' => __DIR__. '/fl-staging',
];

$url = Url::host();
$root = $sites[$url];

$kirby = new Kirby([
  'roots' => [
    'index' => __DIR__ ,
    'site' => $root . '/site',
    'assets' => $root . '/assets',
    'content' => $root . '/content',
    'media' => $root . '/media',
    'accounts' => __DIR__. '/fl-all/site/accounts',
  ]
]);

```

echo $kirby-\>render();`

The directory structure is as follows

```
+ fl-all/
   + site/
      + accounts/
+ fl-prod
   + assets/
   + content/
   + media/
   + site/
      + blueprints/
      + cache/
      + config/
      + sessions/
      + snippets/
      + templates/
- index.php
+ kirby/

```

I am now completely lost: the panel does not work (Javascripts will load the error page which is in the site, i.e. a one of the template/content files). When I move the media to the root level, it works. But the media path `$kirby->roots()->media()` is fl-staging/media` for example.

To me it looks somewhat similar to the effects here: [Panel breaks on multi-site setup with per-site accounts](https://forum.getkirby.com/t/panel-breaks-on-multi-site-setup-with-per-site-accounts/2347)

As a side note: I have some issues with the images in the panel, both icons as well as for example user profile images keep breaking in the panel, but work when running the site itself. Don’t know whether that points to some related issue – I have beforehand suspected that I have made an error in one of the blueprints.

Any thoughts on that?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [August 30, 2019, 7:22pm UTC](https://forum.getkirby.com/t/multi-page-setup-and-issues-with-panel/15451/2 "2019-08-30T19:22:52Z")

</div>

Tried a similar setup locally and couldn’t get it to work, either.

---

<div class="post-metadata">

**Author:** ![baltasar](https://avatars.discourse-cdn.com/v4/letter/b/3d9bf3/32.png) [@baltasar](https://forum.getkirby.com/u/baltasar)\
**Post date:** [August 30, 2019, 7:56pm UTC](https://forum.getkirby.com/t/multi-page-setup-and-issues-with-panel/15451/3 "2019-08-30T19:56:27Z")

</div>

Thanks a lot! That is very helpful to know. If I correctly understand what you have reproduced, this would mean that the information in [https://getkirby.com/docs/cookbook/setup/multisite](https://getkirby.com/docs/cookbook/setup/multisite) is not accurate or that it’s some bug. What do you think? (Depending on that, I could file an issue or just forget about it for the time being).

As for me: I just moved the folder as work-around and will first do without a staging setup.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [August 30, 2019, 9:03pm UTC](https://forum.getkirby.com/t/multi-page-setup-and-issues-with-panel/15451/4 "2019-08-30T21:03:40Z")

</div>

I think it’s probably a bug, already described here: [Can't load panel of multi-site setup after upgrading to 3.2](https://forum.getkirby.com/t/cant-load-panel-of-multi-site-setup-after-upgrading-to-3-2/15411/7), but that sort of mysteriously solved itself. But maybe it just auto-created a media folder somewhere else…

The files do in fact exist but are not recognized as JS files, it seems.

---

<div class="post-metadata">

**Author:** ![baltasar](https://avatars.discourse-cdn.com/v4/letter/b/3d9bf3/32.png) [@baltasar](https://forum.getkirby.com/u/baltasar)\
**Post date:** [August 31, 2019, 9:36am UTC](https://forum.getkirby.com/t/multi-page-setup-and-issues-with-panel/15451/5 "2019-08-31T09:36:56Z")

</div>

Thanks for your support and providing a tech-savier evaluation!

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [August 31, 2019, 10:07am UTC](https://forum.getkirby.com/t/multi-page-setup-and-issues-with-panel/15451/6 "2019-08-31T10:07:14Z")

</div>

I created a bug report an GitHub:

> <https://github.com/getkirby/kirby/issues/2049>

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [August 31, 2019, 10:17am UTC](https://forum.getkirby.com/t/multi-page-setup-and-issues-with-panel/15451/7 "2019-08-31T10:17:58Z")

</div>

Oh, you beat me to it, it wasn’t there when I started mine…

---

<div class="post-metadata">

**Author:** ![baltasar](https://avatars.discourse-cdn.com/v4/letter/b/3d9bf3/32.png) [@baltasar](https://forum.getkirby.com/u/baltasar)\
**Post date:** [August 31, 2019, 10:37am UTC](https://forum.getkirby.com/t/multi-page-setup-and-issues-with-panel/15451/8 "2019-08-31T10:37:16Z")

</div>

Oh sorry, that was unintended – depending on what you deem most suitable, I can well remove mine (if technically possible which I assume).

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [August 31, 2019, 11:19am UTC](https://forum.getkirby.com/t/multi-page-setup-and-issues-with-panel/15451/9 "2019-08-31T11:19:18Z")

</div>

No problem, I’ve closed mine and linked to it from yours…

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [September 16, 2019, 8:34am UTC](https://forum.getkirby.com/t/multi-page-setup-and-issues-with-panel/15451/10 "2019-09-16T08:34:42Z")

</div>

This issue is now closed because the error is in the setup (and missing documentation how to do it correctly)

```auto
$kirby = new Kirby([
  'roots' => [
    'media' => __DIR__. '/media/test'
  ],
  'urls' => [
    'media' => 'http://yourdomain.com/media/test'
  ]
]);

```

---

<div class="post-metadata">

**Author:** ![baltasar](https://avatars.discourse-cdn.com/v4/letter/b/3d9bf3/32.png) [@baltasar](https://forum.getkirby.com/u/baltasar)\
**Post date:** [September 16, 2019, 8:47am UTC](https://forum.getkirby.com/t/multi-page-setup-and-issues-with-panel/15451/11 "2019-09-16T08:47:07Z")

</div>

Hi texnixe,

thank you. I actually had a look at the issue yesterday by chance (as the panel broke due to the wrong setup – corrected with changing the dirs as a work-around). I think the whole directory setup suggested is then bogus (cf. my comment to the issue): when the root is a subdirectory of the site page, you would have [https://site1.example.com/site1/media](https://site1.example.com/site1/media) as URL which really looks ugly. As I don’t know the working mechanics, I cannot make any suggestions at this point, though.

Best,  
Baltasar
