![]() |
htaccess and image paths - 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: htaccess and image paths (/showthread.php?tid=21952) |
htaccess and image paths - El Forum - 08-25-2009 [eluser]Unknown[/eluser] Hello all I'm very new to codeigniter and I'm sure this has been answered many times but I cannot seem to find the answer. I have my CI organised as follows system licence.txt htdocs index.php .htaccess assets images image1.gif application .... In the .htaccess file I have RewriteEngine on RewriteCond $1 !^(index\.php) RewriteRule ^(.*)$ /index.php/$1 [L] I have a controller called hello, which simply loads a view with $this->load->view('mainview.php'); The view file has the following <img src="<?php echo base_url(); ?>assets/images/image1.gif" /> Test When I view this in a browser, via http://mytestsite.co.uk/hello I cannot see the image. If I remove the RewriteRule in .htaccess and go to http://mytestsite.co.uk/index.php/hello I can see the image. Can somebody please advise if a) The directory structure I have above is correct. b) How to remove/hide index.php from url, but have the image included. Thanks in advance Andrew htaccess and image paths - El Forum - 08-25-2009 [eluser]n0xie[/eluser] Try this .htaccess: Code: <IfModule mod_rewrite.c> |