Codeigniter的我的图像文件夹位于根目录中,如下所示
/applications/
/system/
/images/
我正在使用以下代码来显示图像
<img src="<?php echo base_url('images/my_image.jpg'); ?>">
我在img src的HTML标记中获取正确的图像位置, 但不显示图像。
我错过了哪里?您的宝贵意见非常感谢。
答案 0 :(得分:3)
检查你的htaccess文件。是否允许在网页中加载图片。这里我会放一个工作的htaccess文件。试试吧..
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]