烈火工作室
首页 | 网站优化 | CSS布局 | 企业建站 | 网络赚钱
当前位置: 网站优化-seo专题
站内搜索
点击排行
推荐文章
最新文章

IIS Rewrite方法与IIS Rewrite规则收集

1、下载IIS Rewrite模块:http://www.isapirewrite.com/download/isapi_rwl_x86_0059.msi ;

2、将压缩包解压到任意目录,(如:C:\Rewrite)。然后打开“控制面板”-“管理工具”-“IIS信息服务管理器”-“网站”-“您的站点”-“属性”。在“ISAPI筛选器”项点击 “添加”,筛选器名称填入Rewrite,可执行文件为C:\Rewrite\Rewrite.dll ;

3、然后修改httpd.ini 文件,添加相应的过滤规则,例如:

RewriteRule ^(.*)/([a-z0-9\-\_]+)$ $1/Default\.aspx\?id=$2 [I,O]
http://localhost/Text 就会等同于 http://localhost/Default.aspx?id=Text

RewriteRule ^(.*)/id_([a-z0-9\-]+)\.html$ $1/Default\.aspx\?id=$2 [I,O]
http://localhost/id_Text.html 就会等同于 http://localhost/Default.aspx?id=Text

^(.*)/html/([0-9]+)/([0-9]+)\.html$ $1/Default\.aspx\?id=$2&name=$3
http://localhost/html/001/007.html 就等同于 http://localhost/Default.aspx?id=001&name=007

4、重新启动IIS就可以生效了(这一步很重要,每次修改httpd.ini后都要重启 IIS 以加载配置。)

本站http://www.fixty.cn的规则如下:

[ISAPI_Rewrite]

# Defend your computer from some worm attacks
RewriteRule .*(?:global.asa|default\.ida|root\.exe|\.\.).* . [F,I,O]
# asp规则
RewriteRule /Article([0-9,a-z]*).html /Article_Show.asp\?id=$1
RewriteRule /Photo([0-9,a-z]*).html /Photo_show.asp\?id=$1
RewriteRule /([0-9,A-Z]*).html /Article_List.asp\?cataid=$1
RewriteRule ^(.*)/([0-9]+)-([0-9]+)\.html$ $1/Article_Show\.asp\?ID=$2&page=$3
RewriteRule ^(.*)/([0-9,A-Z]+)-([0-9]+)\.html$ $1/Article_List\.asp\?cataid=$2&pageno=$3

日期:2008-8-6   

Copyright 2003-2008 All Rights Reserved 烈火文章管理系统 版权所有
本站内容来自互联网,如有转载或引用文章涉及版权问题,请速与站长联系
[烈火工作室] QQ:839225572 mail:strongfire2008@163.com