htaccess and image paths |
[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
[eluser]n0xie[/eluser]
Try this .htaccess: Code: <IfModule mod_rewrite.c> |
Welcome Guest, Not a member yet? Register Sign In |