Welcome Guest, Not a member yet? Register   Sign In
base URL for external stylesheet ?
#1

(This post was last modified: 05-11-2020, 09:59 AM by jreklund.)

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.
Reply


Messages In This Thread
base URL for external stylesheet ? - by kilden - 05-11-2020, 03:19 AM



Theme © iAndrew 2016 - Forum software by © MyBB