# Panel login after switching to HTTPS

**URL:** <https://forum.getkirby.com/t/panel-login-after-switching-to-https/7881>\
**Category:** Questions\
**Tags:** v2\
**Created:** [July 5, 2017, 1:57pm UTC](https://forum.getkirby.com/t/panel-login-after-switching-to-https/7881 "2017-07-05T13:57:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ebbel](https://avatars.discourse-cdn.com/v4/letter/e/8e8cbc/32.png) [@Ebbel](https://forum.getkirby.com/u/Ebbel)\
**Post date:** [July 5, 2017, 1:57pm UTC](https://forum.getkirby.com/t/panel-login-after-switching-to-https/7881/1 "2017-07-05T13:57:45Z")

</div>

Hello there,

atfer I have switched to HTTPS on my Website I setup my redirects to “non www” to “www only” a and “http” to “https only” I have encountered a problem with me not being able to login into the backend anymore.

If I login with my username and password (which are working 100%, I am able to login when I remove my redirects)  
I will not proceed the the backend.

c::set(‘ssl’,‘true’); is in the config file.

I will just stay at the /panel/login page. Im not really sure if I am getting redirected from the backend back the the /panel/login or if im not getting into the backend in the first place.

I have my .htaccess attached…

* * *

```
# 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 /mysite

# In some enviroments it's necessary to
# set the RewriteBase to:
#
RewriteBase /

RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTPS}s on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [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
# except for requests to plugin assets files
#RewriteRule ^assets/plugins/([a-zA-Z0-9\.\-_%=]+)/(.*)$ site/plugins/$1/assets/$2 [L,N]
#RewriteCond $1 !^plugins/[a-zA-Z0-9\.\-_%=]+/assets/.*
RewriteRule ^site/(.*) index.php [L]

# block direct access to kirby and the panel sources
RewriteRule ^(kirby|panel\/app|panel\/tests)/(.*) 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>

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

```

---

<div class="post-metadata">

**Author:** ![Ebbel](https://avatars.discourse-cdn.com/v4/letter/e/8e8cbc/32.png) [@Ebbel](https://forum.getkirby.com/u/Ebbel)\
**Post date:** [July 5, 2017, 2:45pm UTC](https://forum.getkirby.com/t/panel-login-after-switching-to-https/7881/2 "2017-07-05T14:45:25Z")

</div>

I have now used the www to non www redirect wich is documented in [https://github.com/jenstornell/kirby-secrets](https://github.com/jenstornell/kirby-secrets).  
With this Redirect this problem does not come up.

---

<div class="post-metadata">

**Author:** ![RushmerIO](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/rushmerio/32/4323_2.png) [@RushmerIO](https://forum.getkirby.com/u/RushmerIO)\
**Post date:** [July 6, 2017, 6:00am UTC](https://forum.getkirby.com/t/panel-login-after-switching-to-https/7881/3 "2017-07-06T06:00:20Z")

</div>

I recommend this read on the subject of www to non www:

> **[Why use www? - www. is not deprecated](http://www.yes-www.org/why-use-www/)**
>
> This page is intended for webmasters who are looking for information about whether or not to use www in their canonical web site URLs. First, a bit of terminology. The domain name without www is sometimes referred to as a naked domain, and I’ll refer...

Also, you may want to consider setting the url in your config and using a canonical link meta tag instead of redirects.

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 5:35pm UTC](https://forum.getkirby.com/t/panel-login-after-switching-to-https/7881/4 "2025-02-06T17:35:23Z")

</div>


