具體操作:
一、確認IIS 8.5是否安裝IIS URL Rewrite
jquery1391920086390="116">
打開:控制面板系統和安全管理工具Internet Information Services (IIS)管理器
看到URL重寫,說明已經安裝了IS URL Rewrite,否則要先安裝此插件。
IIS URL Rewrite下載:http://download.microsoft.com/download/4/E/7/4E7ECE9A-DF55-4F90-A354-B497072BDE0A/rewrite_x64_zh-CN.msi
雙擊默認安裝即可
二、添加IIS 8.5偽靜態規則文件
1、新建web.config文件,添加以下代碼,保存
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="category">
<match url="category/?(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="/index.php?category_name={R:1}" appendQueryString="false" logRewrittenUrl="false" />
</rule>
<rule name="tags">
<match url="tag/?(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="index.php?tag={R:1}" />
</rule>
<rule name="Main Rule" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<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>
<rule name="wordpress" patternSyntax="Wildcard">
<match url="*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<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>
</system.webServer>
</configuration>
2、把web.config拷貝到網站根目錄:C:inetpubwwwroot下
三、設置WordPress
進入網站管理后台
設置-固定鏈接-自定義結構
填寫:/archives/%post_id%.html
保存
系統運維 www.111cn.net 溫馨提醒:qihang01原創內容 版權所有,轉載請注明出處及原文鏈接
如下圖所示