Ad

How To Make It So That $this->addCss Adds Https Links Instead Of Http

- 1 answer

In my myproject/themes/mytheme/layouts folder I have a file - default.htm - that reads like this:

description = "Default"
==
<?php
function onStart()
{
$this->addCss('/themes/mytheme/assets/css/bootstrap.min.css');
$this->addCss('/themes/mytheme/assets/css/custom.css');
$this->addCss('/themes/mytheme/assets/css/bootstrap-select.min.css');
}
?>
==
blah blah blah

The problem is that my website is being served up via https while the CSS links generated by $this->addCss() are being added with http (vs https).

How can I make it so that the generated links are https instead of http?

Ad

Answer

$this->addCss() will detect automatically what to use http or https from current scheme.

Still, if you face an issue you can tell OctoberCMS to use https using config.

config/cms.php

enter image description here

if any doubts please comment.

Ad
source: stackoverflow.com
Ad