IIS7.5 的wordpress 的伪静态web.config配置

在 wordpress 根目录,将以下内容保存为 web.config 文件。

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <configuration>
  3.   <system.webServer>
  4.     <rewrite>
  5.       <rules>
  6.                 <rule name="category">
  7.                     <match url="category/?(.*)" />
  8.                     <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
  9.                     <action type="Rewrite" url="/index.php?category_name={R:1}" appendQueryString="false" logRewrittenUrl="false" />
  10.                 </rule>
  11.                 <rule name="tags">
  12.                     <match url="tag/?(.*)" />
  13.                     <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
  14.                     <action type="Rewrite" url="index.php?tag={R:1}" />
  15.                 </rule>
  16.                 <rule name="Main Rule" stopProcessing="true">
  17.                     <match url=".*" />
  18.                     <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
  19.                         <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
  20.                         <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
  21.                     </conditions>
  22.                     <action type="Rewrite" url="index.php/{R:0}" />
  23.                 </rule>
  24.                 <rule name="wordpress" patternSyntax="Wildcard">
  25.                     <match url="*" />
  26.                     <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
  27.                         <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
  28.                         <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
  29.                     </conditions>
  30.                     <action type="Rewrite" url="index.php" />
  31.                 </rule></rules>
  32.     </rewrite>
  33.   </system.webServer>
  34.  
  35. </configuration>
© 版权声明
THE END
喜欢就支持以下吧
点赞0赞赏
分享
相关推荐
  • 暂无相关文章
评论 抢沙发