1、让iis支持rewrite.dll
2、书写规则
将http://localhost/rewrite.asp?page=1伪造成http://localhost/rewrite_1.html
RewriteRule /rewrite_(\d+)\.html /rewrite\.asp\?page=$1 [N,I]
将http://localhost/rewrite.asp?page=1&id=1伪造成http://localhost/rewrite_1_1.html
RewriteRule /rewrite_(\d+)_(\d+)\.html /rewrite\.asp\?page=$1&id=$2 [N,I]
将http://localhost/rewrite.asp?page=1#abc伪造成http://localhost/rewrite_1.html#abc
RewriteRule /rewrite_(\d+)\.html#(\d+) /rewrite\.asp\?page=$1#$2 [N,I]
3、asp代码示例
page=cint(request(“page”))
id=request(“id”)
If page=”” or page<1 Then page=1
If id=”” or id<1 Then id=1
For i=1 to 10
Response.Write “<a href=’rewrite_”&i&”_”&id&”.html’>”&i&”</a>”
Next
未经允许不得转载:王超博客 » ASP网站伪静态规则