现在给客户补全下isapi_rewrite伪静态重写规则,程序是asp、php和asp.net都请下载对应的规则包。
环境:
系统:windows 2003
组件:isapi_rewrite2.x
规则的使用方法:
把规则粘贴复制到httpd.ini 文件中,放到网站的根目录下,就可以对网站的伪静态起作用了。
一、asp程序的静态规则包:
1、对网站的首页
RewriteRule /index.html /index.asp
2、含有参数的动态页
RewriteRule /news/shownews-([0-9,a-z]*)-([0-9,a-z]*).html /news/shownews.asp\?id=$1\&type1=$2
还有更多规则还是请参看规则包
二、PHP程序的静态规则包:
1、网站的首页:
RewriteRule ^(.*)/index.html $1/index\.php
2、含有参数的动态页
RewriteRule ^(.*)/info-id-([0-9]+)\/\?*(.*)$ $1/public/info\.php?id=$2
还有更多规则还是请参看规则包
三、.net程序的静态规则包
1、首页的静态写法:
RewriteRule /index\.html /index\.aspx [N,I]
2、含有参数的动态页的规则:
RewriteRule /zixun/zixun1-([0-9]+)\.html /zixun/zixun1\.aspx\?id=$1 [N,I]
还有更多规则还是请参看规则包
联系客服