图像

IIS wordpress 伪静态配置

公司的技术站转移到西部数码server上,有时不得不使用下iis。

create web.config in your wordpress dir, and the content of it:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="WWW Redirect" stopProcessing="true">
          <match url=".*" />
          <conditions>
          <add input="{HTTP_HOST}" pattern="^cppfun.com$" />
          </conditions>
          <action type="Redirect" url="http://www.cppfun.com/{R:0}" redirectType="Permanent" />
        </rule>
        <rule name="Main Rule" 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" />
        </rule>
      </rules>
    </rewrite>
        <staticContent>
            <mimeMap fileExtension=".woff2" mimeType="application/octet-stream" />
        </staticContent>
  </system.webServer>
</configuration>

发表评论