技术交流QQ群:①185473046   ②190706903   ③203744115   网站地图
登录

下次自动登录
现在的位置: 首页IIS>正文
Windows Server 2012 R2下WordPress IIS8.5伪静态规则设置
2014年01月29日 IIS 暂无评论 ⁄ 被围观 27,761次+

说明:

操作系统:Windows Server 2012 R2

Web服务器:IIS 8.5

网站程序:WordPress

网站根目录:C:\inetpub\wwwroot

网站域名:www.osyunwei.com

实现目的:

配置WordPress伪静态

具体操作:

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

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

三、设置WordPress

进入网站管理后台

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

填写:/archives/%post_id%.html

保存

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

打开http://www.osyunwei.com/archives/1.html,如下图所示

至此,Windows Server 2012 R2下WordPress IIS8.5伪静态规则设置完成。

     

  系统运维技术交流QQ群:①185473046 系统运维技术交流□Ⅰ ②190706903 系统运维技术交流™Ⅱ ③203744115 系统运维技术交流™Ⅲ

给我留言

您必须 [ 登录 ] 才能发表留言!



Copyright© 2011-2024 系统运维 All rights reserved
版权声明:本站所有文章均为作者原创内容,如需转载,请注明出处及原文链接
陕ICP备11001040号-3