WordPress教程

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>
(0)

本文由 创客云 作者:创客云 发表,转载请注明来源!

热评文章

发表评论

嘿,欢迎咨询!