振宇 发表于 2013-4-4 13:50:01

关于CI框架路由的问题

大家好:
          最近在使用Window 2008 IIS7 但是遇到个问题,就是在服务器上运行CI框架 , 访问的时候 出现404 报错
默认运行的index.php/index/index是没有问题的但是在不使用index.php 的情况下就无法访问别的方法和文件

404 - File or directory not found.The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

但是这个代码在linux nginx 上运行是没有问题的,请各位帮忙解释下 这该怎么解决.....

codeigniter_lht 发表于 2013-4-8 01:11:00

碰到了类似的问题,求解决

caipeijie 发表于 2013-4-8 11:26:11

nginx的rewrite书写规则跟IIS是不同的,重新写个IIS的rewrite把请求转到index.php

叶凡 发表于 2013-4-8 12:15:55

在web.config里加上
<rule name="WwwPage" stopProcessing="true">
          <match url="^(.*)$" />
          <conditions logicalGrouping="MatchAll">
            <add input="{HTTP_HOST}" pattern="^365zzy.me$" />
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
          </conditions>
          <action type="Rewrite" url="index.php/{R:1}" />
      </rule>

kinwyb 发表于 2013-9-4 14:22:26

设置下web.config解决
页: [1]
查看完整版本: 关于CI框架路由的问题