wordpress FOR IIS7 URL Rewrite
wordpress 官方已经内置了 IIS7 URL Rewrite 的支持,但对于中文用户来说,官方内置的伪静态规则不能完好的支持中文tag的问题。虽然可以更改系统文件来解决,但比较麻烦,而且不方便,所以一直没介绍过。现在帖出一个自用的的规则,可以解决wordpress的中文tag的问题。
将下列代码加入到web目录下的web.config文件的<system.webServer>之后即可。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | <rewrite>
<rules>
<clear />
<rule name="wordpress2.7" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
<rule name="chinese tag" stopProcessing="true">
<match url="/tag/(.*)" />
<conditions logicalGrouping="MatchAll" />
<action type="Rewrite" url="/index\.php\?tag={R:1}" />
</rule>
</rules>
</rewrite> |


















衣不如新 回复:
七月 20th, 2009 at 1:25 上午
还没试过在二级目录装过wp,你可以尝试一下
[回复]