base URL for external stylesheet ? |
Hello,
This is my first message here and I’m a newbie on Codeigniter 4 (and I didn’t know Ci3). Maybe I don't know a trick to deal with relative path in my stylesheet and I've got this problem : I did an app on local (on root) and now I'm testing it online in a subfolder (« demo ») on my website. I’ve changed baseURL in config files (App.php and .env like : http://mydomain.com/demo/) and added the function baseURL() on all my hyperlinks. So, everything is ok for testing online, except... Every URL in my external CSS sheets are wrong and and I can't change them with a php function. ( for exemple background : url('/img/arrow-top.svg'); should be background : url('demo/img/arrow-top.svg') ) Is there a way to fix that (with Ci4, html, htacess ?) without changing my CSS (and re-change them when I put my website on the root ?) I've tried to put a base in my header : <base href="<?php echo base_url(); ?>/" target="_blank"> ...but this only affect href on my pages... not the relative path inside my external stylesheet. Thank you in advance for any reply. |
Messages In This Thread |
base URL for external stylesheet ? - by kilden - 05-11-2020, 03:19 AM
RE: base URL for external stylesheet ? - by kilden - 05-11-2020, 06:01 AM
RE: base URL for external stylesheet ? - by jreklund - 05-11-2020, 10:03 AM
RE: base URL for external stylesheet ? - by John_Betong - 05-11-2020, 04:30 PM
RE: base URL for external stylesheet ? - by kilden - 05-11-2020, 11:42 PM
RE: base URL for external stylesheet ? - by jreklund - 05-12-2020, 11:01 AM
RE: base URL for external stylesheet ? - by kilden - 05-15-2020, 07:54 AM
RE: base URL for external stylesheet ? - by jreklund - 05-15-2020, 10:00 AM
|