Images in panel wrong url

Hi again,

I’m running a preview of a website on a long url:
which will be

In the frontend everything looks great. In the backend the images have a wrong source:

In the following case

instead of

This is all over the panel. All the images up front are linked just fine. It seems like the panel needs a root variable or something?

Any ideas?

You can try temporarily setting the URL option in the config, but remove it again once your domain flicks over (sounds like MediaTemple to me)…

Unfortunately that didn’t work…

We have exactly the same problem.

In Kirby 2 we solved it in the config with this hack:

    c::set('url', "http://{$_SERVER['SERVER_ADDR']}/plesk-site-preview/{$_SERVER['SERVER_NAME']}/{$_SERVER['SERVER_ADDR']}/");

But in Kirby 3 this doesn’t work. Although images are shown in the panel it gets redirected to a wrong URL and in the frontend subpages are not working anymore.

This is really a big issue to us, no ideas for a solution and why is this URL thing always that big of a problem with plesk previews?

Did you test something like

<?php // file: site/config/config.php

 * The config file accepts _ONE_ return array with config options.
 * Note: Never include more than one return statement, all options go within this single return array!
 * All config options:

    $myurl = "http://{$_SERVER['SERVER_ADDR']}/plesk-site-preview/{$_SERVER['SERVER_NAME']}/{$_SERVER['SERVER_ADDR']}/";  // change this line to fit your need
  } else {
    $myurl = false; // Kirby auto-detects the correct URL

return [
  'debug' => true, // This setting must be set to false in production!!!

  // some code, if you need

  'url' => $myurl,

  // some code, if you need


Maybe you can adapt this: Sharing Kirby sites via Laravel Valet

@anon77445132 That is invalid code, you can’t use an if statement inside the array.

1 Like

Thank you for your important advice, therefore I have changed the code. I hope it works now, I’m waiting for @benm’s answer.

Thank you @anon77445132 and @texnixe , unfortunately the problem was not with migrating the code to kirby 3, I did that with: (sorry for not posting this)

$cgf = [...];

	$cfg['url'] = "http://{$_SERVER['SERVER_ADDR']}/plesk-site-preview/{$_SERVER['SERVER_NAME']}/{$_SERVER['SERVER_ADDR']}/";

return $cfg;

I also tested it with a hard coded URL.

The problem is that this change has effect, but not the one expected, the panel images work but the URL of the browser gets redirected to a broken URL - which is not a problem for using the panel because everything is Ajax, but you can’t reload the panel page.

instead of:

The bigger problem is that subpages in the frontend don’t load anymore and Chrome says “ERR_TOO_MANY_REDIRECTS”…

May be you can set some routes “against” your problems. Sorry, I cannot help you in the details, but with this try you can change every route specific.

Or can you solve this in the plesk admin interface?

I’m using XAMPP (mobile) on every Windows client (I need NO server!!!) as local (!!!) development system. This avoids such problems. You can switch to XAMPP on Windows, Linux or Mac, e.g. look at

Actually I finally solved it in the plesk panel by setting from default to:

I was looking for something like this before and either I was blind or this setting is new :smile:

Anyway, I don’t know why exactly but it solved the problem! :partying_face:

1 Like