sonic 发表于 2010-9-21 09:18:03

我碰到了问题关于默认首页

用了APACHE的REWRITE文件内容如下
RewriteEngine on   
RewriteCond $1 !^(index\.php|html|common|images|rss|css|js|robots\.txt|index\.html)   
RewriteRule ^(.*)$ /ranger33/index.php/$1

然后CI得路由配置文件内容如下
$route['default_controller'] = "";
$route['scaffolding_trigger'] = "";

我再项目根目录底下放了一个index.html希望用它作为网站的默认首页
但是现在CI这样报错

An Error Was Encountered

Unable to determine what should be displayed. A default route has not been specified in the routing file.

我还去修改过默认控制器。为welcome这样就进入到CI给的默认页面了。
现在应该怎么办?
我只是想用根目录下的index.php作为默认首页
用户只要地址栏输入http://www.xxx.com就可以见到index.html这个文件。应该怎么做?

gauspican 发表于 2010-9-21 09:50:57

config > index 文件修改了吗?

Hex 发表于 2010-9-21 09:52:37

$route['default_controller'] = "";
这个必须指定一个默认控制器,你的报错就是说这个为空。

并且,CI 里没有类似 index.html 的东西,你那么写不是 CI。
当然,可以为控制器加个 .html 后缀,但是不存在一个真实的 index.html 文件。

sonic 发表于 2010-9-21 10:46:31

好。我去写个控制器专门显示这个首页的然后把默认控制器设成它。

liuxgnu 发表于 2010-9-21 10:51:30

hex正解   奇怪 您的帖子长度不符合要求。 当前长度: 9 字节 系统限制: 10 到 51200 字节
页: [1]
查看完整版本: 我碰到了问题关于默认首页