最近在捣鼓codeIgniter,感觉上手很快,做一个租房的二级域名子站,最近出现的问题记录一下
本地测试环境,window server 2003+appserver 2.5.9
config配置文件如下
$config['index_page'] = "";
$config['uri_protocol']?= "AUTO";
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt|javascript|css|swf)
RewriteRule ^(.*)$ /index.php/$1 [L]
一切工作正常
?
同事svn,后,很多选项卡提示错误: 同事环境:window server 2008 +php 5.2.10+IIS 7.0
?
A PHP Error was encountered
Severity: Notice
Message: Undefined offset: 2
Filename: models/model_business.php
Line Number: 24
解决办法如下:修改相关配置文件
首先修改config.php
$config['index_page'] = "index.php?";
$config['uri_protocol']? ? = "QUERY_STRING";
然后加上
[ISAPI_Rewrite]
RewriteCond URL ^/(?!js|images|css|index\.php|robots\.txt).*
RewriteRule /(.*) /index.php\?/$1 [I,L]