Windows2012 R2下IIS8.5伪静态规则设置(WordPress实例)

具体操作:

一、确认IIS 8.5是否安装IIS URL Rewrite

jquery1391920086390="116">Windows2012 R2下IIS8.5伪静态规则设置(WordPress实例)

打开:控制面板系统和安全管理工具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 

Windows2012 R2下IIS8.5伪静态规则设置(WordPress实例)

双击默认安装即可

二、添加IIS 8.5伪静态规则文件

1、新建web.config文件,添加以下代码,保存

Windows2012 R2下IIS8.5伪静态规则设置(WordPress实例)

<?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下

Windows2012 R2下IIS8.5伪静态规则设置(WordPress实例)

三、设置WordPress

进入网站管理后台

Windows2012 R2下IIS8.5伪静态规则设置(WordPress实例)

Windows2012 R2下IIS8.5伪静态规则设置(WordPress实例)

设置-固定链接-自定义结构

填写:/archives/%post_id%.html

保存

系统运维  www.111cn.net  温馨提醒:qihang01原创内容 版权所有,转载请注明出处及原文链接

如下图所示

Windows2012 R2下IIS8.5伪静态规则设置(WordPress实例)

转载于:https://www.cnblogs.com/starxp/articles/4549882.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值