【发布时间】:2016-08-19 14:19:16
【问题描述】:
我不是很熟悉 IIS,但我试图从请求中隐藏 .php 扩展名,并且我还希望它在添加 尾部斜杠时能够工作。
以下内容可以很好地提供没有 .php 扩展名的 PHP 文件,但它不适用于尾部斜杠 (404)。
<rule name="rewrite php">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" negate="true" pattern="(.*).php" />
</conditions>
<action type="Rewrite" url="{R:1}.php" />
</rule>
允许使用或不使用斜杠的正确方法是什么?
【问题讨论】:
标签: php azure iis web-config