Kirby2: Login Problems on Live Server

Hi,
I have upgraded a project to kirby 2. The site works fine, after some adaptations, especially concerning the multi language support. But I have problems with the panel login on the live server. I copied the accounts from my development server to the live server, but after login the login screen appears again, without any error message. I have deleted the accounts on the live server. In this case kirby throws this error message: “The content folder and all contained files and folders must be writable.” But this folder and all files are definitely writable :frowning:

Any ideas?

Thank you,
Christian

The following folders must exist for the panel to work:

  • site/accounts
  • assets/avatars
  • thumbs

Thank you … but all folders do exist

But on your development server you can login with the accounts? Be aware that you can’t keep the same account files from Kirby 1 for Kirby 2:

Kirby 2 has a completely rewritten user management which supports secure password encryption. Old account files are thus no longer compatible with your new installation.

Thank you! Yes, on my dev Server everthing works fine. And yes, I’ve created new Kirby 2 Accounts.

Fixed. The .gitignore had an entry “api/”. Therefore the folder panel/app/controllers/api/ was missed.

Having this exact issue, hoping I can get some help:

The current setup I’m working on is in a subfolder (“/kirby”), and the above issue only happens when I add .htaccess Rewrite rules to remove the subfolder from public page URLs (i.e. “http://amyharrity.com/portfolio” instead of “http://amyharrity.com/kirby/portfolio”).

I can’t seem to get BOTH of the following to work simultaneously: (1) removing the subfolder from public page URLs, and (2) get the panel to load correctly.


Here are some relevant files that may be helpful (I also already ensured all necessary directories exists and are writable).

“.htaccess” — public_html

<IfModule mod_rewrite.c>

RewriteEngine On
RewriteBase /

# Force non 'www.' address
RewriteCond %{HTTP_HOST} ^www\.amyharrity\.com [NC]
RewriteRule ^(.*)$ http://amyharrity.com/$1 [L,R=301]

# Redirect to Kirby directory
RewriteCond %{HTTP_HOST} ^amyharrity\.com$ [NC]
RewriteRule ^(.*)$ /kirby/$1 [L]

</IfModule>

“.htaccess” — public_html > kirby

# Kirby .htaccess

# rewrite rules
<IfModule mod_rewrite.c>

# enable awesome urls. i.e.:
# http://yourdomain.com/about-us/team
RewriteEngine on

# make sure to set the RewriteBase correctly
# if you are running the site in a subfolder.
# Otherwise links or the entire site will break.
#
# If your homepage is http://yourdomain.com/mysite
# Set the RewriteBase to:
#
# RewriteBase /kirby

# block text files in the content folder from being accessed directly
RewriteRule ^content/(.*)\.(txt|md|mdown)$ error [R=301,L]

# block all files in the site folder from being accessed directly
RewriteRule ^site/(.*) error [R=301,L]

# block all files in the kirby folder from being accessed directly
RewriteRule ^kirby/(.*) error [R=301,L]

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

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

</IfModule>

# Additional recommended values
# Remove comments for those you want to use.
#
# AddDefaultCharset UTF-8
#
# php_flag short_open_tag on

“config.php” — public_html > kirby > site > config

<?php

/*

---------------------------------------
License Setup
---------------------------------------

Please add your license key, which you've received
via email after purchasing Kirby on http://getkirby.com/buy

It is not permitted to run a public website without a
valid license key. Please read the End User License Agreement
for more information: http://getkirby.com/license

*/

c::set('license', '...');
c::set('url', 'http://amyharrity.com');
c::set('subfolder', '/kirby');
c::set('cache', false);
c::set('cache.driver', 'file');

/*

---------------------------------------
Kirby Configuration
---------------------------------------

By default you don't have to configure anything to
make Kirby work. For more fine-grained configuration
of the system, please check out http://getkirby.com/docs/advanced/options

*/

Have you tried with those two lines removed?

I did—removing those lines gets the panel working (and solves the original login issue), but the subfolder is then included in the URLs of public pages (“/kirby”), which brings us back to the issue: finding a solution that allows the panel to work properly and removes the subfolder from URLs of public pages.

I tried as many combinations of settings I could think of that would be causing the issue, which included:

  • “url” and “subfolder” settings in config.php
  • “RewriteBase /kirby” in the [public_html > kirby] .htaccess
  • second RewriteRule in the [public_html] .htaccess

I have a feeling it involves the last point above, which I’ve added because the Kirby filebase is in an enclosing folder.

Server Folder Structure

public_html
     .htaccess
     billing
     client
     dev
     kirby
          .htaccess
          assets
          …

Any more help would be greatly appreciated!

And your provider doesn’t allow to point your main domain to a subfolder without using a .htaccess I guess?

It does, but the lines I added to the main directory’s .htaccess to redirect the main domain to a directory are populated on that same page (cPanel “Redirects” page) as a redirect, so it seems it wouldn’t make a difference if I tried to set this redirect via the cPanel for this client’s account.

Also, there’s a note on the server’s cPanel about not being able to redirect the main domain to a different directory:

“You cannot use a Wildcard Redirect to redirect your main domain to a different directory on your site.”

Still don’t understand why the public pages for this Kirby website display but any attempt to log into the panel just redirects back to the panel login (w/o any error messages or notes from Kirby).

I’m having a similar issue. My Dev team thinks it’s an issue with the load balancer. I can occasionally get past the login screen for 1-2 clicks but then it’ll kick me back to the login screen. This is only on live server, the panel works perfectly in our staging environment.

A post was split to a new topic: Panel does not work in subdirectory

Got the same problem. Get kicked right out after one click inside the panel. Then I have to login again :frowning: