yesterday we went live and it works quite well so far. I had to adjust the htaccess file to redirect all non-www traffic to www.*
Now I can’t login to panel anymore. When I click on “Login”, I do not see a error message, but the login page refreshes and form fields are cleared.
What can I do?
htaccess file:
# 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 /
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
# block text files in the content folder from being accessed directly
RewriteRule ^content/(.*)\.(txt|md|mdown)$ index.php [L]
# block all files in the site folder from being accessed directly
RewriteRule ^site/(.*) index.php [L]
# block all files in the kirby folder from being accessed directly
RewriteRule ^kirby/(.*) index.php [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>
Interesting. But can you login at https://www.mydomain.com/panel if you disable the rewrite rule? Still trying to figure out if it’s the rewrite rule or something else. Because the rewrite rule shouldn’t be able to cause this.
I had the same issue with redirecting to https + www. also on an 1and1-host.
I couldn’t login to the panel on the production-environment.
After i set the url in the production-config, it works fine.
c::set('url', 'https://www.mydomain.com');
but i was wondering, why does the auto url not recognize the www?