ASP网站伪静态规则

1、让iis支持rewrite.dll 2、书写规则 将http://localhost/rewrite.asp?page=1伪造成http://localhost/rewrite…

asp

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

本文来自网络,不代表24小时课堂在线立场,转载请注明出处:https://www.24ketang.cn/3105.html

为您推荐

返回顶部