用户
 找回密码
 入住 CI 中国社区
搜索
查看: 1680|回复: 8
收起左侧

[讨论/交流] 无法获取css资源,不是引用的问题

[复制链接]
发表于 2016-6-13 10:42:26 | 显示全部楼层 |阅读模式
下了xampp,配置好之后,自己写了一个项目,但是无法获取css资源,这不是引用问题。具体是这样的:输入这样的地址:https://localhost/LcnCart/,点击。然后就变成这样了:https://localhost/en/LcnCart/,多出了一个en,就无法获取css资源,不知道是那么配置错了,请大神指点。
发表于 2016-6-13 10:50:45 | 显示全部楼层
你怎麼設置的 ?
提供一段 css 呼叫方式來看看
 楼主| 发表于 2016-6-13 10:56:00 | 显示全部楼层
Closer 发表于 2016-6-13 10:50
你怎麼設置的 ?
提供一段 css 呼叫方式來看看

这是代码 $data['css'][0] = "<link type='text/css' rel='stylesheet' href='".base_url()."css/home2010.css'>";
这是在页面源代码点击css的情况
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Object not found!</title>
<link rev="made" href="mailto:webmaster@localhost" />
<style type="text/css"><!--/*--><![CDATA[/*><!--*/
    body { color: #000000; background-color: #FFFFFF; }
    a:link { color: #0000CC; }
    p, address {margin-left: 3em;}
    span {font-size: smaller;}
/*]]>*/--></style>
</head>

<body>
<h1>Object not found!</h1>
<p>


    The requested URL was not found on this server.

  

    If you entered the URL manually please check your
    spelling and try again.

  

</p>
<p>
If you think this is a server error, please contact
the <a href="mailto:webmaster@localhost">webmaster</a>.

</p>

<h2>Error 404</h2>
<address>
  <a href="/">localhost</a><br />
  <span>Apache/2.4.17 (Win32) OpenSSL/1.0.2d PHP/5.6.15</span>
</address>
</body>
</html>

发表于 2016-6-13 11:10:26 | 显示全部楼层
南方随歌起 发表于 2016-6-13 10:56
这是代码 $data['css'][0] = "";
这是在页面源代码点击css的情况

問題來自於 Object not found! => route 而非 css
 楼主| 发表于 2016-6-13 11:16:58 | 显示全部楼层
Closer 发表于 2016-6-13 11:10
問題來自於 Object not found! => route 而非 css

是啊,可能我没说清楚,这是因为地址栏上面多了一个en,所以获取不到,我想问的是这个en怎么来的,怎么去掉,搞不明白刚才排查了一下,CI里面的代码没有问题,应该是xampp错了,可是找不成原因
发表于 2016-6-13 11:20:58 | 显示全部楼层
南方随歌起 发表于 2016-6-13 11:16
是啊,可能我没说清楚,这是因为地址栏上面多了一个en,所以获取不到,我想问的是这个en怎么来的,怎么去 ...

en 應該是指英文語系
看看你 CI 中 config / route.php
進入 localhost/LcnCart 時那個控制器,是否有重定向
 楼主| 发表于 2016-6-13 11:54:18 | 显示全部楼层
Closer 发表于 2016-6-13 11:20
en 應該是指英文語系
看看你 CI 中 config / route.php
進入 localhost/LcnCart 時那個控制器,是否有重 ...

没有,刚刚试了一下,在xampp下的hosts目录下,新建一个info.php,地址栏一样会出现一个en:http://loaclhost/en/info.php
发表于 2016-6-13 17:36:42 | 显示全部楼层
多出来的en应该在alias里面配置的新的程序吧?,虚拟目录不同,程序不同。
 楼主| 发表于 2016-6-14 10:14:04 | 显示全部楼层
找出来啦,是htdocs目录下的一个项目文件配置错了,去掉这个项目之后就没问题,虽然不知道为什么会影响到其他的项目

本版积分规则