19 lines
878 B
Plaintext

<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Rewrite to index.php" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<!-- 检查请求路径不是实际文件 -->
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<!-- 检查请求路径不是实际目录 -->
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<!-- 重写到index.php并保留原始查询参数 -->
<action type="Rewrite" url="index.php" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>