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 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算