宝塔用户_sgpxhc 发表于 2023-8-8 14:29:46

Windows+iis6宝塔下WordPress伪静态规格下分类、标签失效的问题

宝塔里原来的的规则:
<?xml version="1.0" ?>
<rules>
        <rule name="category_rewrite">
                <match url="category/?(.*)"/>
                <conditions logicalGrouping="MatchAll" trackAllCaptures="false"/>
                <action type="Rewrite" url="/index.php?category_name={R:1}" appendQueryString="false" logRewrittenUrl="false"/>
        </rule>
        <rule name="tags_rewrite">
                <match url="tag/?(.*)"/>
                <conditions logicalGrouping="MatchAll" trackAllCaptures="false"/>
                <action type="Rewrite" url="index.php?tag={R:1}"/>
        </rule>
        <rule name="Main Rule_rewrite" stopProcessing="true">
                <match url=".*"/>
                <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
                </conditions>
                <action type="Rewrite" url="index.php/{R:0}"/>
        </rule>
        <rule name="wordpress_rewrite" patternSyntax="Wildcard">
                <match url="*"/>
                <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                        <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="WordPress: https://ruderal.cn_rewrite" patternSyntax="Wildcard">
                <match url="*"/>
                <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
                </conditions>
                <action type="Rewrite" url="index.php"/>
        </rule>
</rules>


在第9行的tag前添加一个“/”以修改标签路径:
<match url="/tag/?(.*)"/>
保存,无需重启IIS,问题解决。

页: [1]
查看完整版本: Windows+iis6宝塔下WordPress伪静态规格下分类、标签失效的问题