问题
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