我的Codeigniter映像文件夹位于根目录中,如下所示
/applications/
/system/
/images/
我正在使用以下代码来显示图像
<img src="<?php echo base_url('images/my_image.jpg'); ?>">
我在img src的HTML标记中获得了图像的正确位置,但是没有显示图像。
我在哪里错过它?非常感谢您的宝贵建议。
检查您的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]
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句