【问题标题】:How to set up url rewrite in iis for WordPress?如何在 iis 中为 WordPress 设置 url 重写?
【发布时间】: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,这可能会有所帮助,但它没有任何效果。

谢谢大家

【问题讨论】:

标签: php wordpress iis url-rewriting


【解决方案1】:

解决了!这是因为应用程序池不是 32 位的。只需一次更改、回收并像魅力一样工作!

【讨论】:

    猜你喜欢
    • 2020-10-06
    • 2018-12-06
    • 1970-01-01
    • 2012-11-05
    • 2011-04-20
    • 2012-06-19
    • 2021-06-26
    • 2011-02-07
    • 1970-01-01
    相关资源
    最近更新 更多