Iis6重写Url隐藏Index.php之后Cgridview等中的Ajax请求无法响应

大家好!!

我的网站项目在配置apache的时候通过.htaccess重写隐藏了index.php之后,CGridView等里面的ajax有响应,但是使用iis6之后ajax都没有相关的响应,也就是无法翻页。

下面是我针对iis的httpd.ini文件配置

[ISAPI_Rewrite]

RewriteRule /(?!images)(?!css)(?!scripts)(?!nbproject)(?!assets)(?!themes)(?!protected)(.*)$ /index\.php [I,L]

麻烦大家帮我看看,弄了好几天还没解决这个问题 :unsure:

写点打印语句, 先确定ajax请求到了php没有, 如果没有的话就在iis上找原因,如果有再查一下参数什么的

check out this

我的网站根目录和yii文件夹是并列关系的,index.php代码如下:




<?php

// change the following paths if necessary

$yii=dirname(__FILE__).'/../yii/framework/yii.php';

$config=dirname(__FILE__).'/protected/config/main.php';


// remove the following lines when in production mode

defined('YII_DEBUG') or define('YII_DEBUG',true);

// specify how many levels of call stack should be shown in each log message

defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);


require_once($yii);

$app=Yii::createWebApplication($config);

Yii::app()->setTimeZone('UTC');

$app->run();



我的猜想是 我在配置httpd.ini的时候只配置了网站根目录里面的内容被重写并且隐藏index.php,但是根目录外的yii内容则无法读取,CGridView等的ajax都无法响应,下面是我现在的httpd.ini内容:




[ISAPI_Rewrite]

RewriteRule /(?!favicon.ico)(?!images)(?!css)(?!scripts)(?!nbproject)(?!assets)(?!themes)(?!protected)(.*)$ /index\.php [I,L]



大家帮我看看,我应该怎样修改呢?

我后来改过了httpd.ini的内容,现在可以实现ajax响应了。

但是修改的内容我也是上网找的,可以实行具体的原因我还不了解,虽然不是Yii的问题,也希望大家知道原因的可以留言帮我解答一下。

谢谢~~




[ISAPI_Rewrite]

RewriteRule /(?!favicon.ico)(?!images)(?!css)(?!scripts)(?!nbproject)(?!assets)(?!themes)(?!protected)(.*)$ /index\.php\?s=$1 [I]