【发布时间】:2020-07-04 16:05:18
【问题描述】:
我有一个用于 IIS 的web.config,如果没有定义的页面(即index.php),它可以部分地将请求重写到另一个本地wwwroot 文件夹。
所以像:www.blah.net/something/index.php 这样的 url 显示的页面是正确的。
但是,www.blah.net/something/ 会重写到另一个 URL 并忽略该目录中的 index.php。
<configuration>
<system.webServer>
<defaultDocument enabled="true" />
<rewrite>
<rules>
<rule name="RewriteAll" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="_h5ai/public/index.php" appendQueryString="true" />
</rule>
</rules>
</rewrite>
<caching enabled="false" enableKernelCache="true" />
</system.webServer>
</configuration>
【问题讨论】:
-
你有什么问题?你是说这就是它的作用还是你想要它做的?
-
我的默认文档被忽略了。如果站点有 index.php,除非我在其中定义带有 index.php 的 URL,否则它不会显示该站点...我希望 web.config 在返回到重写规则之前首先检查默认页面。跨度>
标签: php iis web-config