wordpress固定连接设置后 分类文章打不开

wordpress固定连接设置后 分类文章打不开

如果在启用 WordPress 伪静态后分类页面无法正常访问

很可能是因为 IIS Rewrite 模块的规则没有正确匹配 WordPress 分类页面的 URL。

可以尝试在 web.config 文件中添加针对 WordPress 分类页面的规则,先用ftp下载web.config文件用记事本打开 

填写下面代码保存好后,上传服务器就能解决了

代码:


<?xml version="1.0" encoding="UTF-8"?>

<configuration>

  <system.webServer>

    <rewrite>

      <rules>

        <rule name="Category" stopProcessing="true">

          <match url="^category/([^/]+)/?$" />

          <action type="Rewrite" url="index.php?category_name={R:1}" />

        </rule>

        <rule name="Tag" stopProcessing="true">

          <match url="^tag/([^/]+)/?$" />

          <action type="Rewrite" url="index.php?tag={R:1}" />

        </rule>

        <rule name="WordPress" 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/{R:0}" />

        </rule>

      </rules>

    </rewrite>

  </system.webServer>

</configuration>


推荐推门
搜索
标签
«    2024年3月    »
123
45678910
11121314151617
18192021222324
25262728293031
网站分类
文章归档
 
Copyright © 2021张少学习分享网 All Rights Reserved 黔ICP备2021004591号