[ERROR] Invalid Panel URL

Hello, I’ve just updated my kirby installation with the latest one but I’m getting some problems with the panel.

I get this error:

// react on invalid routes
if(!$this->route) {
throw new Exception(l(‘routes.error.invalid’));

I’m unable to solve it… I can’t understand where the problem reside.
Hope someone could help me!
Thank you!

Do you get the same problem with a fresh Starterkit?

Have you cleared the browser cache?

yes… I get the same error with a Starterkit…

This page is currently offline due to an unexpected error. We are very sorry for the inconvenience and will fix it as soon as possible.

Have you tried to switch back to 2.3.2?

No issue switching back to the previous version…

I found the issue… I think… but I have no idea on how to solve it…

My kirby installation is inside public_html(root)/kirby folder.

In my public_html .htaccess I have this piece of code that make kirby folder like root folder:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www\.)?mysite\.com$ [NC]
RewriteRule ^(.*)$ kirby/$1 [L]

and in my /kirby .htaccess I have this:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /kirby
RewriteRule ^content/(.*)\.(txt|md|mdown)$ index.php [L]
RewriteRule ^site/(.*) index.php [L]
RewriteRule ^kirby/(.*) index.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^panel/(.*) panel/index.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [L]

If I go to mywebsite.com/panel I get the error, if I go to mywebsite.com/kirby/panel I’m able to login!!!
Actually in the previous version ok kirby, when visiting mywebsite.com/panel it automatically redirect to mywebsite.com/kirby/panel. Personally I prefer the cleaner version of links without /kirby. I made some tries on .htaccess but I didn’t solve anything.
Hope you can help me!

Thank you!

The cleanest way would be to point the domain to the subfolder in your domain settings instead of doing this via the .htaccess in the root folder.

But try by removing the RewriteBase, by either commenting it out, or setting it to /.

Done but nothing… :cry:

Isn’t it possible to point the domain to the kirby subfolder?

Need to check but, if with the previous version it worked, why it couldn’t still work in the latest? Is there no way to repair the main code?

Changing the web root this way is unsupported, there must be another way to set this up at your hosting provider.

It’s very hard to debug this, so I’m afraid we won’t be able to fix this for this special case.

Hello @lukasbestle! Thank you for your answer… I just asked to my hosting provider to directly point the website to the subfolder but he just answer me with the same .htaccess rules I posted… so this is why I think this issue should be considered… the previous version of kirby worked but not with the latest… so, there might be an issue or something that could be changed in the core? Thank you!

Could you please try changing:

RewriteBase /kirby


RewriteBase /

in your /kirby/.htaccess?

Done, the issue still there and the images links are broken… :sob:

Three options, I think:

  • put the Kirby site into the root folder
  • get your hosting provider to point the domain to the subfolder
  • move to another hosting provider where you can point the domain to a subfolder (this is usually possible without .htaccess fiddling)

Hi everyone!
I investigate the issue…Some of theme were generated by a possible wrong php.ini. I set it with default values and the only issue I’m still having is the “Invalid Panel URL”.

The Kirby debug tell me there is an issue there: public_html/kirby/panel/app/src/panel.php Line: 392

    // react on invalid routes
if(!$this->route) {
  throw new Exception(l('routes.error.invalid'));

The difference between the v2.4.0 and the previous one (on these lines) is “try { … }”

Actually, the previous version instantly redirect me to the correct path: example.com/kirby/panel . v2.4.0 instead it doesn’t, looking to example.com/panel without success…

I tried to add this to my .htaccess but it doesn’t work:

# make panel links work
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^panel/(.*) kirby/panel/index.php [L]


# make panel links work
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^kirby/panel/(.*) kirby/panel/index.php [L]

Thank you in advance and best wishes for your holidays!

In config.php I’ve add this:
c::set(‘url’, ‘http://example.com’);
otherwise the “Kirby” folder will appear on my URL like this: http://example.com/kirby

I need to re-open this thread. Even in the last update I’m getting this issue. I’m stuck at Version 2.2.2 and I need to updato to a latest one for plugins compatibility.
Thank you!

I’m afraid I don’t have a solution for you. As Lukas pointed out earlier in this thread, your particular setup is not really supported. Would be interesting to see the complete stack trace of the error you get, though.

Maybe you can experiment with a solution similar to this suggested one for Drupal: https://www.drupal.org/node/144643 (this is just an idea, I have no means to test your specific setup).

Maybe your hosting provider can offer a solution, if not, maybe you can choose another provider with a more robust domain setup.

Thank you for your answer but with the previous version of kirby it worked… why we can’t make it working again!