URL 静态化可以提高搜索引擎抓取,开启本功能需要对 Web 服务器增加相应的 Rewrite 规则,且会轻微增加服务器负担。本教程讲解如何在 IIS 环境下配置各个产品的 Rewrite 规则。首先要下载一个组件,叫ISAPI_Rewrite
打开??http://www.helicontech.com/download-isapi_rewrite.htm,选择ISAPI_Rewrite Lite for Windows NT4/2000/XP/2003
目前的最新版本为:isapi_rwl_x86_0072.msi,下载下来安装 (http://www.phpwind.net/read-htm-tid-671630.html)
![]()
一些习惯性的next就不多说了


选择安装的目录,一般放在C盘(根据服务器环境而定,没有硬性要求,我个人习惯把这个写放在与php/mysql平行的目录)


安装的时候会自动加载到IIS服务,可以看图

打开IIS配置查看ISAPI选项的加载状态

很好已经加载上了,下一步就是写规则了

安装完后会自动生成一个只读属性 的httpd.ini??,要改成可写属性,然后编写规则
如图
![]()
规则如下,或者直接下载附件~!~
PW伪静态如下:
[ISAPI_Rewrite]
# Defend your computer from some worm attacks
RewriteRule .*(?:global.asa|default.ida|root.exe|\.\.).* . [F,I,O]
RewriteRule ^(.*)-htm-(.*)$ $1.php?$2
RewriteRule ^(.*)/simple/([a-z0-9_]+.html)$ $1/simple/index.php?$
#Code By Josh @ PHPWind 2008-10-08 ?([a-zA-Z]+)
DZ 伪静态规则:
[ISAPI_Rewrite] CacheClockRate 3600 RepeatLimit 32 RewriteRule ^(.*)/archiver/((fid|tid)-[\w\-]+\.html)\?*(.*)$ $1/archiver/index\.php\?$2&$4 RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forumdisplay\.php\?fid=$2&page=$3&$4 RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/viewthread\.php\?tid=$2&extra=page\%3D$4&page=$3&$4 RewriteRule ^(.*)/space-(username|uid)-(.+)\.html\?*(.*)$ $1/space\.php\?$2=$3&$4 RewriteRule ^(.*)/tag-(.+)\.html\?*(.*)$ $1/tag\.php\?name=$2&$3









评论关闭。