shishirui 发表于 2008-2-17 13:18:53

请问,我加上.htaccess后,样式表的路径调用不对了?

加上.htaccess后,控制器方法的确可以不要index.php访问,比如
以前要这样访问:
http://localhost/ci/index.php/blog/view/2
现在这样访问就可以了:
http://localhost/ci/blog/view/24

但是以前可以这样访问CSS文件:
http://localhost/ci/css/style.css
现在这样却不可以访问了,出现:
404 Page Not Found
The page you requested was not found.

难道程序也把css当成控制器了?请问如何解决?

[ 本帖最后由 shishirui 于 2008-2-17 13:20 编辑 ]

shishirui 发表于 2008-2-17 13:52:02

顶顶~~~~~~~~~~~~~~~~~~~~~~~

[ 本帖最后由 shishirui 于 2008-2-17 13:54 编辑 ]

Hex 发表于 2008-2-17 13:58:52

参考:http://codeigniter.org.cn/forums/thread-4-1-1.html

这就是条件:RewriteCond $1 !^(index.php|images|robots.txt)

你需要设置 rewrite 条件,也就是某些目录不进行转向,这个你看看 apache rewrite 的文档。

shishirui 发表于 2008-2-17 14:07:08

哈哈,果然好了,谢谢hex,我的爱

沧蓝 发表于 2008-2-17 17:28:42

咳咳同志们要勤看手册呀。。。CI的最大优势就是完善的手册哦~

Hex 发表于 2008-2-17 18:08:33

是呀~~要多看手册!~!

shishirui 发表于 2008-2-17 18:56:17

我看了唉,没找到才来问的,现在找到了~
页: [1]
查看完整版本: 请问,我加上.htaccess后,样式表的路径调用不对了?