CSS wont trigger in live production with CodeIgniter framework

爱⌒轻易说出口 提交于 2020-01-24 22:42:08

问题


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-

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.


回答1:


grandluis.000webhostapp.com - your css are loaded in http while you're accessing your website through https

You have to update your config.php to:
$config['base_url'] = 'https://grandluis.000webhostapp.com';

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" />



来源:https://stackoverflow.com/questions/53492070/css-wont-trigger-in-live-production-with-codeigniter-framework

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!