path instead of baseurl - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: path instead of baseurl (/showthread.php?tid=36306) |
path instead of baseurl - El Forum - 11-28-2010 [eluser]Unknown[/eluser] Hi I’m new to CI ( great work, thx) an have following problem: I don’t like use full url “http://www.mydomain.com/mypath/images/a.jpg” within links I want use “/mypath/images/a.jpg”. I need function like: function baseurl_path(){ $base= base_url(); $f= ‘/.*’.$_SERVER[‘SERVER_NAME’].’/’; $b= preg_replace($f, ‘’, $base); return b; } Can I find it in CI or not? path instead of baseurl - El Forum - 11-28-2010 [eluser]InsiteFX[/eluser] Why not use CodeIgniters HTML helper and the img tag. InsiteFX path instead of baseurl - El Forum - 11-28-2010 [eluser]pbreit[/eluser] Try setting base_URL to '/mypath/' |