Why my source files get http instead of https


I build a new web site and in the template I linked the css files and javscript file

<link href="https://www.website.ch/manager/templates/name/css/bootstrap-5-0-0/bootstrap.min.css" rel="stylesheet">
<script src="https://www.website.ch/manager/templates/user/js/jquery-3.6.0.min.js"></script>

The problem is with all pages, the above link are with https, but the home page is with http.

When I clean the cache, the home page work fine with https, but this evening, I oberved the home page only is back with http

Why only the home page change to http and how can make sure to have always https?

Some resource are not using the same template than the home page. But some ressource are using the same template as for the home page, but thoses ressource work fine

I never had a such problem. Can I fix that in the setting or with the htacess file??

Many thanks

First, check the server_protocol System Setting.

Also, your .htaccess file may be converting www URLs to non-www (or vice versa), and setting the URL to http rather than https. Or, it may be setting the URL to https, but ignoring URLs that contain, or don’t contain www.

@bobray Can you explain what the server_protocol setting does?
Personally I never change this setting and I don’t have problems.
Also in this issue on github the original poster says that “After I opened this issue i learned that server_protocol does nothing.”, which I tend to believe is true.

1 Like

I have to admit I didn’t even know that setting was there - and all my sites run on https.

as far, as I can tell, this setting isn’t used anywhere

make sure, you call [[!++site_url]] uncached

Making sure your .htaccess is configured to always redirect to https should also help wrong values getting in the cache to begin with.

The server_protocol setting is not used. The equivalent setting is now url_scheme and should be automatically determined from your server during each request unless specifically added to system (or context) settings along with http_host, base_url, and site_url.

1 Like

Thanks for the updates on server_protocol. I’ve read the suggestion to check it many times, so I assume must have done something at some time. :wink: