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']

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

报告相同问题?

悬赏问题

  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题