---
title: "IIS+WordPress利用UrlRewrite实现永久链接(Permanent Links)的完美方案"
author: "zu14"
date: "2010-01-11T21:26:00Z"
tags: []
slug: "iis-wordpress-urlrewrite-permanent-links"
draft: false
lastmod: "2010-01-11T21:26:00Z"
id: 779851
url: "https://zu14.iteye.com/blog/779851"
---

![wordpress iis url rewrite permalink](http://images.cnblogs.com/cnblogs_com/sjcatsoft/WindowsLiveWriter/IIS6WordPressPermantLinks_B8C4/1_9d65be0e-148d-4400-bbf4-359bf2424339.jpg "wordpress iis url rewrite permalink")

 

向来，很多人都诟病 [IIS](http://www.zu14.cn/tag/iis/) + [Wordpress](http://www.zu14.cn/tag/wordpress) 的这个组合，主要是体现在 [IIS](http://www.zu14.cn/?tag=iis) 在 Url Rewrite 上面太弱了![](http://www.zu14.cn/coolemotion/emotions/zz_7.gif)![](http://www.zu14.cn/coolemotion/emotions/zz_11.gif) ，真不知道 [微软](http://www.microsoft.com) 怎么想的！！搞个Web服务器平台，居然不支持Url重写，汗死！！

这次，我自己迁移BLOG平台，也遇到了同样的问题，嘿嘿。网上搜了一圈后，找到了这个比较完美的方案，就是利用 [IIS](http://www.zu14.cn/?tag=iis) 的ISAPI方式了。

有个老外（老外这方面都比较牛，嘿嘿，关键是***免费精神好***），发布了这个ISAPI插件，地址在 [http://www.binaryfortress.com/wordpress-url-rewrite/](http://www.binaryfortress.com/wordpress-url-rewrite/ "http://www.binaryfortress.com/wordpress-url-rewrite/") 。

而且，提供了免费的论坛支持，非常赞 ![](http://www.zu14.cn/coolemotion/emotions/hi_9.gif)

目前最新的版本是1.1，1.0版本也相同。只是差别在是否需要 VC 运行库上。1.0需要单独安装VC2005的运行库，1.1不需要。

 

下载后，解压缩，可以看到里面有4个文件：

![wordpress urlrewrite](http://images.cnblogs.com/cnblogs_com/sjcatsoft/WindowsLiveWriter/IIS6WordPressPermantLinks_B8C4/image_573bc2ed-fa15-46c5-b9ee-723e4af6eeb9.png "wordpress urlrewrite")

其中，txt文件是说明文件，没有实际用途； ini文件是重写规则的配置文件；2个DLL文件，分别是32位和64位系统使用的。因为我是32位的系统，所以我就选择 wordpressurlrewrite32.dll 就可以了。

 

打开 [IIS](http://www.zu14.cn/?tag=iis) 管理器，定位到网站，右键属性，切换到 ISAPI  筛选器这个TAB页：

![iis 属性](http://images.cnblogs.com/cnblogs_com/sjcatsoft/WindowsLiveWriter/IIS6WordPressPermantLinks_B8C4/image_aa7caf88-87ee-4c5c-8914-911e44918e29.png "iis 属性")

 

点击“添加”，筛选器名称，随便写一个，浏览到刚才的DLL文件，确定即可。

![iis urlrewrite isapi](http://images.cnblogs.com/cnblogs_com/sjcatsoft/WindowsLiveWriter/IIS6WordPressPermantLinks_B8C4/image_409f52ee-5d4d-4409-a1c6-f02ea3a46aa3.png "iis urlrewrite isapi")

 

然后，去打开 wordpressurlrewrite.ini文件，看里面的规则是否适合你，根据情况自己进行相应的改动即可。

 

确认之后，需要重启IIS或者电脑。重启好之后，再到 ISAPI 筛选器里看，看到

![image](http://images.cnblogs.com/cnblogs_com/sjcatsoft/WindowsLiveWriter/IIS6WordPressPermantLinks_B8C4/image_650ea5dd-da12-4ab8-80c3-f71bd035a116.png "image")

 

看到绿色的箭头，说明该ISAPI扩展已经添加成功了。到WORDPRESS后台，在 **设置---&gt;固定链接**里， 设置你自己的固定链接格式，保存。

 

此时，你可以去访问你的网址，看看是否生效了。![](http://www.zu14.cn/coolemotion/emotions/tu_2.gif)