【发布时间】:2010-10-24 19:57:34
【问题描述】:
我正在尝试使用 PHP5 (fastcgi) 在 IIS7 上为 Wordpress MU 2.7 配置 rewrite 规则。
目前我在 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 的永久链接结构无关!如果我删除重定向index.php,行为是相同的。我认为没有任何 PHP 代码正在运行……这必须是更高级别的。
【问题讨论】:
-
您在 Wordpress 中对永久链接结构有哪些设置?
-
这有关系吗?目前我仍然得到两个 url 的 404 错误,因为我已经排除了所有其他规则并且没有明显找到子文件夹;还没有 php 正在运行。