繁体   English   中英

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

[英]Missing images after I redirect to a subdirectory using route.php and/or .htaccess in CodeIgniter Framework

我重定向了

意见/ hello.php

到此URL路径,而不创建子目录:

www.domain.com/subdir/hello

通过使用route.php

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

但是,hello.php内的某些图片不见了。 我检查了“图像”文件夹,但它仍然存在。

我检查了检查元素,但出现错误:

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

我研究了此错误,但没有得到任何解决。 没有重定向,图像仍然存在。 请帮忙。

添加编辑:

这也在检查元素控制台错误中显示

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 

htacces或路由在这里无关紧要。 您的路线是错误的。 使用它,它将随处可用

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

假设您不对config.php文件的参数$config['base_url']进行任何更改

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM