No https generated Assets and always generating cache files

Hello.

All assets have http like images css and so on. And also the cache is always generating files even if I deactivated it in the config.

This is my config.php

<?php
return [
    'debug'  => true,
    'languages' => true,
	'url' => '*',
    'cache' => [
        'pages' => [
            'active' => false
        ]
    ],
    'routes' => [
        [
            'pattern' => 'projekte',
            'action' => function () {
                $page = page('projekte');
                $firstChild = $page->children()->first();
                if ($firstChild)
                    return go($firstChild->url());
            }
        ],
    ]
];

and the htaccess

# Kirby .htaccess
# revision 2023-07-22

# 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 environments it's necessary to
# set the RewriteBase to:
#
RewriteBase /

# block files and folders beginning with a dot, such as .git
# except for the .well-known folder, which is used for Let's Encrypt and security.txt
RewriteRule (^|/)\.(?!well-known\/) index.php [L]

# block all files in the content folder from being accessed directly
RewriteRule ^content/(.*) index.php [L]

# block all files in the site folder from being accessed directly
RewriteRule ^site/(.*) index.php [L]

# block direct access to Kirby and the Panel sources
RewriteRule ^kirby/(.*) index.php [L]

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

</IfModule>

# pass the Authorization header to PHP
SetEnvIf Authorization "(.+)" HTTP_AUTHORIZATION=$1

# compress text file responses
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE application/json
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>

# set security headers in all responses
<IfModule mod_headers.c>

# serve files as plain text if the actual content type is not known
# (hardens against attacks from malicious file uploads)
Header set Content-Type "text/plain" "expr=-z %{CONTENT_TYPE}"
Header set X-Content-Type-Options "nosniff"

</IfModule>

What sort of files do you find in the cache folder?

I have .cache files in both folders, file and page:

cache

  • uuid
    • file
    • page

Those files are related to uuids, not to the page cache, so this is expected.

Ah, ok. And what about the assets not having https? Any ideas?

This sounds like Kirby is trying to find out what the site’s base URL is based on environment information set by the website’s host and available on PHP’s $_SERVER array. Chances are your host or web server is setting $_SERVER['SERVER_NAME'] or something like this to a URL that starts with http:// instead of https://.

See url | Kirby CMS for an explanation and the 'url' config option that you can use to explicitly tell Kirby what base URL to use.

I thought something like this, because I already tried to set the exact url in the config. But this also didn’t work out. Thats why I tried the * wildcard option, which would be fine because its a dev server, but without luck :frowning:

You can force https in your server config, using the .htaccess file.

RewriteCond %{HTTPS}  !=on 
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

Thanks. That didn’t help either but the site is now on the live domain and the problem is gone. Maybe it was something with the preview url from the hoster but still not sure what it was. Thanks anyway!