2015-06-09 23 views
1

重定向到一个子目录,我重定向缺少图片后,我用route.php和/或在的.htaccess笨框架

views/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 
+0

告诉你如何构建它 –

+0

不能在MVC直接访问视图图像链接,请精心设计你的问题 – Viral

+0

@Rejoanul Alam Climate Solutions hazelvan

回答

1

htacces或路由此处无关紧要。你的路径错了。利用这一点,就可以在所有

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

假设你不做出config.php文件的参数的任何变化$config['base_url']

+0

对不起,我的答复,只是检查它被缓存。无论如何,这工作! :)你摇滚@Rejoanul阿拉姆! :) – hazelvan

+0

@hazelvan谢谢。祝您愉快 –