【发布时间】:2022-01-25 16:23:25
【问题描述】:
如何在 IIS 中设置重写 url 以在没有 index.php 的情况下加载我的页面?例如。 https://blog.sunamo.cz/2021/12/25/s/ 是 404,但 https://blog.sunamo.cz/index.php/2021/12/25/s/ 是 200。
它不再出现在设置中:
Lex Li:很遗憾,没有。似乎 IIS 不使用重写规则。我已添加:
<rule name="RequestBlockingRule1" patternSyntax="Wildcard" stopProcessing="true">
<match url="*" />
<conditions>
<add input="{URL}" pattern="*.php" />
</conditions>
<action type="CustomResponse" statusCode="401" statusReason="Unauthorized: Access is denied due to invalid credentials" statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
IIS 中的测试将匹配 url https://blog.sunamo.cz/index.php,而不是 https://blog.sunamo.cz/index.ph,但 https://blog.sunamo.cz/index.php 在没有 401 的情况下仍在加载。
同样,如果我使用来自 stackoverflow 等的任何 sn-p,这可能会有所帮助,但它没有任何效果。
谢谢大家
【问题讨论】:
-
这能回答你的问题吗? URL Rewrite IIS and Wordpress
标签: php wordpress iis url-rewriting