[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:

Exception
// 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]
</IfModule>

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

to

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]

and

# 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!

EDIT:
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!