dongmingxiang0312 2015-06-09 09:05
浏览 45
已采纳

使用CodeIgniter Framework中的route.php和/或.htaccess重定向到子目录后丢失图像

I redirected

views/hello.php

to this url path, without creating a subdir:

www.domain.com/subdir/hello

by using route.php

$route['subdir/hello'] = 'pages/view/hello';

however, some of the pictures that's inside hello.php were gone. I checked the "images" folder but it's still there.

I did check Inspect Element and there was an error:

Resource interpreted as Image but transferred with MIME type text/html

I've researched with this error but I didn't get any resolution. Without the redirection the images are still there. Please help.

Adding Edit:

This is also shown in the inspect element console error

GET http://p.nexac.com/e/sr/a-1548/s-3271/s-3271.xgi net::ERR_BLOCKED_BY_CLIENT
getSegment.php?purl=http%3A%2F%2Fwwf.org.ph%2Fclimate-solutions&jsref=&rnd=1433844490975:1 
GET http://adadvisor.net/adscores/r.pixel?sid=9212270798 net::ERR_BLOCKED_BY_CLIENT
getSegment.php?purl=http%3A%2F%2Fwwf.org.ph%2Fclimate-solutions&jsref=&rnd=1433844490975:1 
  • 写回答

1条回答 默认 最新

  • dpd46554 2015-06-09 10:38
    关注

    htacces or routing doesn't matter here. Your path is wrong. Use this, it will work everywhere

    <img src="<?php echo base_url('images/wwd_climate-solutions.jpg');?>" alt="Climate Solutions">
    

    assuming that you do not make any change to config.php file's parameter $config['base_url']

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 ensp,用局域网解决
  • ¥15 Python语言实验
  • ¥15 我每周要在投影仪优酷上自动连续播放112场电影,我每一周遥控操作一次投影仪,并使得电影永远不重复播放,请问怎样操作好呢?有那么多电影看吗?
  • ¥20 电脑重启停留在grub界面,引导出错需修复
  • ¥15 matlab透明图叠加
  • ¥50 基于stm32l4系列 使用blunrg-ms的ble gatt 创建 hid 服务失败
  • ¥150 计算DC/DC变换器平均模型中的参数mu
  • ¥25 C语言代码,大家帮帮我
  • ¥15 请问以下文字内容及对应编码是用了什么加密算法或压缩算法呢?
  • ¥50 关于#html5#的问题:H5页面用户手机返回的时候跳转到指定页面例如(语言-javascript)