CodeIgniter Forums
base_url() problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: base_url() problem (/showthread.php?tid=70332)



base_url() problem - davides98 - 03-26-2018

Hello everybody, 

Hi everyone, I have a problem with base_url
I do not understand why when I put <?php echo base_url ()?> asset / css / style.css
I can not reach my destination.
The link is correct in fact if I write the same in the browser I get to the css file.
in practice from what I understand the result I get is: localhost / site / localhost / asset / css / style.css
how can i get:
localhost / assets / css / style.css
using base_url ();



RE: base_url() problem - InsiteFX - 03-26-2018

Code:
<!-- Custom Web Application CSS Overrides. -->
<link href="<?php echo base_url('assets/css/style.css'); ?>" rel="stylesheet">

But you are saying asset when in fact it is assets below bottom line.


RE: base_url() problem - skunkbad - 03-26-2018

Why do you need to use base_url at all? Why not:

<link href="/asset/css/style.css" rel="stylesheet">