Force https site

I have a site with version 3.2.2 but it is not automatically redirecting to the https version of the site nor the panel. I did set SSL true in my config. I there a way to force the https site?

my config file looks like this:

return [
	'debug' => false,
	'ssl' => true

There is no SSL option in Kirby 3. You can set the URL:

But enforcing HTTPS should happen in your server config file or in your .htaccess if you don’t have access to the server configuration or in your hosting’s panel.

1 Like

Just for completeness, you can paste this in your .htaccess file right below # RewriteBase /

#redirect http to https
<IfModule mod_rewrite.c>
 RewriteCond %{HTTPS} off
 RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Only reason I’m adding this is because some implementations don’t correctly redirect. For example,
would redirect to

As @texnixe mentioned, HTTP to HTTPS redirection should only be performed in .htaccess if you do not have access to the server or virtual host configuration file, see When not to use mod_rewrite.

If you do have access to the config, the recommended way is

<VirtualHost *:80>
    Redirect "/" ""

<VirtualHost *:443>
    # ... SSL configuration goes here

And if you prefer a permanent redirection replace the sole word “Redirect” with “Redirect 301” or “Redirect permanent” or “RedirectPermanent”, which are all equivalent, but Redirect alone will do a temporary or 302 redirection.