I’m developing a website with codeigniter, and I have a simple issue.
For html and styles I’m using base_url() for paths to work, but in html source a full path including http://
My folder structure is like this:
application/
system/
my_template/
*styles.css
*images/
*etc.etc.
index.php
when I’m on index.php/controller/method/param1/param2, I want to set e.g css path like this:
<link href="../../../my_template/styles.css" rel="stylesheet" type="text/css" media="screen" />
But with using base_url() they become like this:
<link href="http://www.site.com/my_template/styles.css" rel="stylesheet" type="text/css" media="screen" />
How can I do this for css and <script> tags ? I’m sure I’m missing a simple step, but could not find it. I’m using CI 2.03.
Thanks,
You can use
/to reference a file relative to the root directory of your web site.Both paths will reference the same file assuming you are on http://www.site.com/.