我正在尝试使用 PHP5 (fastcgi) 在 IIS7 上为 Wordpress MU 2.7 配置重写规则。
目前我在 Web.config 中只有以下重写规则:
<rule name="Canonical Host Name" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_HOST}" negate="true"
pattern="^subdomain\.example\.com$" />
</conditions>
<action type="Redirect"
url="http://subdomain.example.com/{R:1}"
redirectType="Permanent" />
</rule>
在我输入 URL 的那一刻(见下文),它确实重定向到正确的主机名,但由于某种原因在路径前加上index.php/
:
url: `http://subdomain/my/path/123`
redirects to: `http://subdomain.example.com/index.php/my/path/123`
should redirect to: `http://subdomain.example.com/my/path/123`
有谁知道为什么会这样以及如何防止这种情况发生?
我是否缺少某个服务器设置或其他东西......?php.ini?web.config 规则?还是只是我的重写规则错了?
编辑:这个问题似乎与 Wordpress 的永久链接结构无关!如果我删除 redirect ,行为是相同的index.php
。我认为没有任何 PHP 代码正在运行……这必须处于更高的级别。