亲测好用WordPress在win2008-IIS7.5下的web.config伪静态规则

新装了IIS7.5 WIN2008 R2 伪静态一直没搞定,百度使劲找,终于找到个好用的一起分享:

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

2776

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

2777

双击默认安装即可

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

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

2778

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

2779

三、设置WordPress

进入网站管理后台

2780

2781

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

填写:/archives/%post_id%.html

保存

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


免责声明:
1、本站部分内容由用户自行上传分享,仅供分享学习交流,未经上传用户或原创作者书面授权,请勿作他用或商用。
2、具体内容发布者信息,可以通过文章底部左下角“头像”区域查看。
3、本站对所有发布信息一律经过审核后发布,但因版权以及作者信息追溯复杂,并没有相关可追溯查源系统;我站只能尽己方之力进行审核,并号召大家尊重版权,希望原创作者发现后第一时间联系我站进行删除处理。
4、我站要求外来转发或者分享信息务必保留来源等相关信息,希望得到原创作者的鼓励和认可;帮助您获得更多用户的认可。
5、未尽事宜,请联系微信:93547942 菠菜哥,协商处理。
砚台酪-18年致力于帮助实体商家、企业更低成本、更高效的做好互联网营销推广!! » 亲测好用WordPress在win2008-IIS7.5下的web.config伪静态规则
在线客服
在线客服
热线电话
QQ客服