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

标签 codeigniter iis azure url-rewriting

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

我可以在没有特定模块的情况下重写 Codeigniter 的 index.php 的 URL 吗?

最佳答案

您可以在 web.config 文件中添加重写规则。将以下内容添加到 system.webServer 部分:

<rewrite>
  <rules>
    <rule name="Rule" stopProcessing="true">
      <match url="^(.*)$" ignoreCase="false" />
      <conditions>
        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
        <add input="{URL}" pattern="^/favicon.ico$" ignoreCase="false" negate="true" />
      </conditions>
      <action type="Rewrite" url="index.php/{R:1}" appendQueryString="true" />
    </rule>
  </rules>
</rewrite> 

关于codeigniter - 如何在Windows Azure上重写Codeigniter的index.php,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9965124/

相关文章:

mysql - 使用 session ID 过滤数据

sql-server - Azure SQL : Keep alive option

azure - 通过 Azure B2C 登录用户获取 Microsoft Graph API token 以便根据用户上下文进行操作的最佳方法是什么

iis - 希望在我的 IIS 服务器上设置某种 cron 等效项

google-chrome - Chrome 现在将 localhost 的 IP 地址视为与 somesite.localhost 相同

sql - IIS 和 SQL 可以在同一个 Azure 虚拟机上运行吗?

azure - 在某些 Synapse Serverless View 上授予登录 SELECT 权限,但无法在*整个* Datalake 上运行 OPENROWSET

php - 广度优先搜索方式的一般树遍历(无限)

php - 在 Codeigniter + PostgreSql 中使用 $this->db->num_rows()

php - 使用 codeigniter/php 的实体属性值模型