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

CI初始化配置的问题

[复制链接]
发表于 2008-6-8 22:40:45 | 显示全部楼层 |阅读模式
环境如下:vista ,xampp1.6.6a。
按照说明安装配置了CI。
通过http://localhost:8080/ 已经可以访问到 ci的 Welcome to CodeIgniter! 页面。
config里面$config['base_url']    = "http://localhost:8080/";

按照例子,在controllers 目录里面又写了一个Blog 的控制器。
<?php
class Blog extends Controller {

    function Blog()
    {
        parent::Controller();   
    }
   
    function index()
    {
        echo "hello world";
    }
}
?>
但是通过http://localhost:8080/blog 则报告如下错误:
Object not found!

The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

If you think this is a server error, please contact the webmaster.
Error 404
localhost
06/08/08 22:58:51
Apache/2.2.8 (Win32) DAV/2 mod_ssl/2.2.8 OpenSSL/0.9.8g mod_autoindex_color PHP/5.2.5

在论坛里面查了新手帮助,但是没有找到类似的问题。
我尝试更改了$route['default_controller'] = "blog";后,用http://localhost:8080/ 可以看到这个hello world输出。但是用http://localhost:8080/blog 以及 http://localhost:8080/welcome 都是同样的错误。

请问,这是什么原因造成的呢?

[ 本帖最后由 ottochen 于 2008-6-8 22:48 编辑 ]
发表于 2008-6-9 14:21:32 | 显示全部楼层
http://localhost:8080/index.php/blog
 楼主| 发表于 2008-6-9 22:57:06 | 显示全部楼层
感谢nase!
通过http://localhost:8080/index.php/blog 来访问正常!

想了一下明白了:是因为默认情况下xampp默认没有打开apache 的rewrite,所以.htaccess定向不起作用。

本版积分规则