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

分享
源代码 2024-10-2 14:02:04 99 0 来自 中国
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>


文章泉源:https://www.zhangshuyan.com.cn/21.html
您需要登录后才可以回帖 登录 | 立即注册

Powered by CangBaoKu v1.0 小黑屋藏宝库It社区( 冀ICP备14008649号 )

GMT+8, 2024-10-18 16:48, Processed in 0.121174 second(s), 32 queries.© 2003-2025 cbk Team.

快速回复 返回顶部 返回列表