CSS不会使用CodeIgniter框架在实时生产中触发 [英] CSS wont trigger in live production with CodeIgniter framework
问题描述
我的项目有问题。它没有任何错误,但是当我尝试将其上传到一些免费的托管站点时,CSS不会触发。这是我第一次上载我的项目,因此,请给我发送URL grandluis.epizy.com/grand/或 https:// grandluis。 000webhostapp.com ,我的目录就是这样。
I'm having an issue with my project. It has no errors and something but when I tried to upload it on some free hosting sites The CSS wont trigger. This is my first time uploading my project so guys this the url grandluis.epizy.com/grand/ or https://grandluis.000webhostapp.com and my directory was like this.
/htdocs-
-------/grand-
-------------/application-
-------------/assets-
-------------/system-
-------------.editorconfig
-------------.htaccess
-------------.composer.json
-------------.contributing.md
-------files for your website should be uploaded here-
-------index2.html-
.hraccess-
.override-
DO NOT UPLOAD FILES HERE-
,我注意到,如果您单击网站上的url按钮,css将触发。我认为,如果您手动键入URL,CSS只会触发。
and I notice something that if you click a url button on the website the css will trigger. I think the CSS only wont trigger if you typed the URL manually.
推荐答案
grandluis.000webhostapp.com-您的CSS会加载到通过https访问网站时使用http
grandluis.000webhostapp.com - your css are loaded in http while you're accessing your website through https
您必须将config.php更新为:
$ config ['base_url'] ='https://grandluis.000webhostapp.com';
You have to update your config.php to:
$config['base_url'] = 'https://grandluis.000webhostapp.com';
此外,如果您不这样做但是,加载资产时请使用 base_url
。
示例:
< link href =<?= base_url(' path / to / your / style.css');?> rel = stylesheet />
Also, if you're not doing it yet, use base_url
when loading assets.
Example:
<link href="<?=base_url('path/to/your/style.css');?>" rel="stylesheet" />
这篇关于CSS不会使用CodeIgniter框架在实时生产中触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!