Hello,
I managed to setup lets encrypt on my uberspace server (very easy) and now I’ve the following issue with the panel. I get kicked out randomly when trying to login to the panel. Sometimes I get in and can move around a bit and then get kicked out. Sometimes I end up directly on the login form again. Possibly this is caused by htaccess, it’s mostly the standard htaccess from kirbys basekit with this additions/changes:
RewriteBase /
# redirect to https
# https://wiki.uberspace.de/webserver:htaccess#https_erzwingen
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{ENV:HTTPS} !=on
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
There is no error regarding redirection or so in my error log, I tried to setup a user for @lukasbestle and the Server throws the following issue:
[Sun Dec 27 17:47:31 2015] [warn] [client 87.144.228.118] mod_fcgid: stderr: PHP Fatal error: Call to a member function direction() on null in /var/www/virtual/user/html/domain.de/panel/app/src/panel.php on line 353, referer: https://domain.de/panel/users/add
That pretty much looks like an incomplete installation of Kirby and doesn’t seem to be caused by your RewriteRules. Try recursively cloning a Kirby starterkit directly on the server and changing the .htaccess in that installation. That should work.
Same result, installed it in a subfolder, changed the .htaccess accordingly and added the subfolder in the config.php now I’m not even able to create the initial user.
Hi, no nothing. I removed the second installation again. @lukasbestle I checked also my main installation, all submodules and the main repository are up to date with origin/master besides the changes I made to .htaccess etc. I should mention that everything works fine if I remove the redirect to https from my .htaccess and work only on http.
What I just saw: You use the RewriteEngine On directive twice now after you added the rewriting code. I don’t know how that could cause your issue, but please remove it anyway.
I tested this with a fresh starter kit on Uberspace (although not with a let’s encrypt certificate, but with the uberspace wildcard one), and I encountered the same problem. If I set the rewrite base, I can create the initial user, but no chance to log in with that user. I’m constantly redirected to the login form.
I just tested it as well on Uberspace with Kirby 2.2.3 using a StartSSL certificate. It works for me (even using TLS) when just setting the RewriteBase (make sure to clear your browser cache when testing this again!).
I’m having the same problem with the Uberspace HTTPS enforcement rules enabled though, even if I’m already using TLS. I have also tried to disable the rule for the Panel, but even that didn’t work:
You guys should tweet this topic to uberspace (@ubernauten) on Twitter. They respond within minutes. And since they are at the 32c3 they are probably awake
Uberspace contacted me, but while they where looking at the problem I found the solution myself. I’m serving multiple URIs and have dedicated folders for each of them in my html/ like:
html/URI1 ←Kirby is in here
html/URI2
.htaccess
Turns out, you’ve to set the RewriteBase / also in the html/.htacces as well as in the Kirby .htaccess.
Enforcement of https needs to take place in Kirby .htaccess.
This seems to work for me right now, I still had some awkward logouts but I’m blaming caching.
Let me know your thoughts.
Edit: Well, it’s not yet perfect. Still having awkward logouts.