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

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

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

#1 User is offline   jolin_p 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 15-January 13

Posted 22 January 2013 - 04:22 AM

大家好!!
我的网站项目在配置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:
0

#2 User is offline   hehbhehb 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 50
  • Joined: 24-February 12

Posted 22 January 2013 - 06:47 AM

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

#3 User is offline   rootbear 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 225
  • Joined: 17-June 11

Posted 22 January 2013 - 10:02 AM

check out this
I enjoy the Yii.sy coding life here.
0

#4 User is offline   jolin_p 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 15-January 13

Posted 23 January 2013 - 04:01 AM

我的网站根目录和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]


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

#5 User is offline   jolin_p 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 15-January 13

Posted 24 January 2013 - 06:00 AM

我后来改过了httpd.ini的内容,现在可以实现ajax响应了。
但是修改的内容我也是上网找的,可以实行具体的原因我还不了解,虽然不是Yii的问题,也希望大家知道原因的可以留言帮我解答一下。
谢谢~~
[ISAPI_Rewrite]
RewriteRule /(?!favicon.ico)(?!images)(?!css)(?!scripts)(?!nbproject)(?!assets)(?!themes)(?!protected)(.*)$ /index\.php\?s=$1 [I]

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users