【发布时间】:2016-01-30 17:48:52
【问题描述】:
我正在尝试从基于窗口的托管中隐藏 .php 扩展名。
我正在使用 web.config 尝试这个
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rule name="hide .php extension" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="{R:1}.php" />
</rule>
</rewrite>
</system.webServer>
</configuration>
显示404错误,请指出问题出在哪里。
谢谢。
【问题讨论】:
-
这条规则适用于我的环境。我认为它与您的重写规则无关。你检查过事件日志吗?你的 php 处理程序如何为 iis 工作,它应该是 fast-cgi 吗?
标签: php iis url-rewriting web-config window-server