网络安全 频道

引擎优化:用ISAPI_Rewrite实现asp的静态化

5.这一步很重要哦,开始添加rewrite规则.正则,好头痛,幸亏这个例子比较简单.
找到ISAPI_Rewrite目录,把httpd.ini的只读属性去掉,打开编辑.我们要把1ting.asp?inso=im286映射成为1ting-im286.html这样的类型,需要在httpd.ini里加上这么一行:
   
RewriteRule /1ting-([0-9,a-z]*).html /1ting.asp/?inso=$1


,保存.
screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt=''Click here to open new window/nCTRL+Mouse wheel to zoom in/out'';}" border=0>

6.来来来,到浏览器里查看一下效果吧.输入http://127.0.0.1/1ting.asp?inso=im286和 http://127.0.0.1/1ting-im286.html,显示的内容是不是都是im286?这就证明成功啦!
screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt=''Click here to open new window/nCTRL+Mouse wheel to zoom in/out'';}" border=0> screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt=''Click here to open new window/nCTRL+Mouse wheel to zoom in/out'';}" border=0>

嘿嘿,1ting-im286.html这样的页面要比1ting.asp?inso=im286容易收入,所以现在还在用动态方式的朋友可以尝试一下这样的静态映射效果. IIS Rewrite也可以实现这样的功能.

后话:如果你没有自己的服务器,就不能用这种方法了

http://www.hack58.net/Article/60/63/2006/12655.htm

0
相关文章