Reputation: 520
My image folder of Codeigniter is in root directory as follows
/applications/
/system/
/images/
I am using following code to display the images
<img src="<?php echo base_url('images/my_image.jpg'); ?>">
I am getting the correct location of image in HTML markup in img src, but not displaying the image.
Where i missed it ? Your valuable advices are highly appreciated.
Upvotes: 1
Views: 12724
Reputation: 929
Check your htaccess file.Whether it has allowed images to load in the webpage.Here i'll put a working htaccess file.Try it..
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]
Upvotes: 3