如何在 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/