首页 > 计算机应用 > 利用IIS的ISAPI_Rewrite组件实现dvbbs静态化

利用IIS的ISAPI_Rewrite组件实现dvbbs静态化

      早就听说过很多动态论坛可以静态化以提高搜索引擎的抓取率,以前只是粗略的了解过,前几天仔细看看了dvbbs的帮助文件,发现利用IIS的ISAPI_Rewrite组件可以轻松的实现这一功能。

      就到网上下了ISAPI_Rewrite,这里大家要注意,它分两个版本:Lite版和Full版,区别是Lite版只支持整台服务器部署,不能针对服务器上的各个站点单独设置,而Full版则无此限制。 Well, Lite版是完全免费的,而Full是收费的商业版。那就免费的Lite吧,下载安装之后,在安装目录下(默认路径为:"C:\Program Files\Helicon\ISAPI_Rewrite3\Helicon Manager.exe")找到httpd.conf文件,用记事本等文本编辑工具打开,加入dvbbs帮助中要求添加的代码,如下:

复制内容到剪贴板程序代码程序代码
# 重写index.asp
RewriteRule /index_(\d+)_(\d*)_(.*)_(\d*)\.html /index\.asp\?boardid=$1&topicmode=$2&list_type=$3&page=$4 [N,I]
RewriteRule /index_(\d+)_(.*)_(\d*)_(.*)_(\d*)\.html /index\.asp\?boardid=$1&action=$2&topicmode=$3&list_type=$4&page=$5 [N,I]
RewriteRule /index_(\d+)_(.*)_(\d*)_(\d*)\.html /index\.asp\?boardid=$1&action=$2&topicmode=$3&page=$4 [N,I]
RewriteRule /index_(\d+)_(\d*)_(.*)\.html /index\.asp\?boardid=$1&page=$2&action=$3 [N,I]
RewriteRule /index_(\d+)_(\d*)\.html /index\.asp\?boardid=$1&topicmode=$2 [N,I]
RewriteRule /index_(\d+)_(\d*)_\.html /index\.asp\?boardid=$1&page=$2 [N,I]
# RewriteRule /index_(\d+)__\.html /index\.asp\?boardid=$1 [N,I]
RewriteRule /index_(\d+)\.html /index\.asp\?boardid=$1 [N,I]
RewriteRule /index\.html(.*) /index.asp [N,I]
# 重写dispbbs.asp
RewriteRule /dispbbs_(\d+)_(\d*)_(\d*)_skin(\d*)_(\d*)_(\d*)\.html /dispbbs\.asp\?boardid=$1&replyid=$2&id=$3&skin=$4&page=$5&star=$6 [N,I]
RewriteRule /dispbbs_(\d+)_(\d*)_(\d*)_skin(\d*)_(\d*)\.html /dispbbs\.asp\?boardid=$1&replyid=$2&id=$3&skin=$4&star=$5 [N,I]
RewriteRule /dispbbs_(\d+)_(\d*)_(\d*)_skin(\d*)\.html /dispbbs.asp\?boardID=$1&replyid=$2&ID=$3&skin=$4 [N,I]
RewriteRule /dispbbs_(\d+)_(\d*)_(\d*)_(\d*)\.html /dispbbs.asp\?boardID=$1&ID=$2&page=$3&star=$4 [N,I]
RewriteRule /dispbbs_(\d+)_(\d*)_(\d*)_(\w+)\.html /dispbbs.asp\?boardID=$1&ID=$2&page=$3&move=$4 [N,I]
RewriteRule /dispbbs_(\d+)_(\d*)_(\d*)\.html /dispbbs.asp\?boardID=$1&ID=$2&page=$3 [N,I]
RewriteRule /dispbbs_(\d+)_(\d*)\.html /dispbbs.asp\?boardID=$1&ID=$2 [N,I]
# 重写dv_rss.asp
RewriteRule /dv_rss_(.*)_(\d+)_(\d+)_(\d+)_(\d+)_count(\d+)\.html /dv_rss.asp\?s=$1&boardid=$2&id=$3&page=$4&star=$5&count=$6 [N,I]
RewriteRule /dv_rss_(.*)_(\d+)_(\d+)_(\d+)_(\d+)\.html /dv_rss.asp\?s=$1&boardid=$2&id=$3&page=$4&star=$5 [N,I]
RewriteRule /dv_rss_(.*)_(\d+)_(\d+)_(\d+)\.html /dv_rss.asp\?s=$1&boardid=$2&id=$3&page=$4 [N,I]
RewriteRule /dv_rss_(.*)_(\d+)_(\d+)_count(\d+)\.html /dv_rss.asp\?s=$1&boardid=$2&page=$3&count=$4 [N,I]
RewriteRule /dv_rss_(.*)_(\d+)_(\d+)\.html /dv_rss.asp\?s=$1&boardid=$2&page=S3 [N,I]
RewriteRule /dv_rss_(.*)_(\d+)\.html /dv_rss.asp\?s=$1&boardid=$2 [N,I]
RewriteRule /dv_rss_(.*)\.html /dv_rss.asp\?s=$1 [N,I]
RewriteRule /dv_rss(.*)\.html(.*) /dv_rss.asp [N,I]

      保存, 接着打开IIS,依次展开计算机名(本地计算机)/网站/默认网站,右键-属性-ISAPI筛选器-“添加…“,名称自己取,可执行文件浏览至上面ISAPI的安装目录,选中"ISAPI_Rewrite.dll”,确定。 再返回dvbbs目录下的conn.asp修改“IsUrlreWrite”的值为1,开启论坛伪静态,保存。
      至此,大功告成,再回到本地看一下自己的论坛,首页已经变成index.html了,各板块和文章也已经成了静态化的网页。

转载请尊重版权,出处:秋天博客
本文链接: https://www.cfresh.net/pc-tech/504

  1. 还没有评论
评论提交中, 请稍候...

留言



注意: 您给他人的评论回复将通过邮件通知到对方。

可以使用的标签: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
Trackbacks & Pingbacks ( 0 )
  1. 还没有 trackbacks