Windows2012 R2下IIS8.5伪静态规则设置(WordPress实例)
具体操作:
一、确认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原创内容 版权所有,转载请注明出处及原文链接
如下图所示