如何在Windows Server和IIS上的codeigniter中删除index.php?

ian*_*ian 9 iis codeigniter windows-server-2003

如何在Windows Server和IIS上的codeigniter中删除index.php?

当我寻找答案时,我发现了这个

如何在Windows Azure上重写Codeigniter的index.php

但是当我尝试我的CI仍然需要index.php来运行web.config文件必须添加并且在编辑我的web.config之前还有其他步骤吗?

Man*_*zha 17

如果未安装URL Rewrite模块,请从此处安装http://www.iis.net/downloads/microsoft/url-rewrite

请检查完整的web.config文件.将它放在放置index.php的同一文件夹中.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="Imported Rule 1" stopProcessing="true">
          <match url="^(.*)$" ignoreCase="false" />
          <conditions logicalGrouping="MatchAll">
              <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
              <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
          </conditions>
          <action type="Rewrite" url="index.php?url={R:1}" appendQueryString="true" />
          </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>
Run Code Online (Sandbox Code Playgroud)

它在Windows Server 2008 R2中的IIS中工作