一个关于URL改写的例子
<%@ import namespace="system.io"%>
<script runat="Server" Language="VB">
sub Application_Beginrequest
dim str1,str2,str3 as string
str1=request.path.tolower()
'if str1.indexof("/repath/")<>-1 then
str2=string.format("user.aspx?pageowner={0}",path.getfilenamewithoutextension(str1))
context.rewritepath(str2)
'end if
end sub
</script>下面是测试文件
<%@ import namespace="system.io"%>
这个是USER。ASPX页面,这里是接受改写的一个虚拟文件名:
<%=request.querystring("pageowner")%>
<p />
你可以把上在的USER。ASPX修改成任何一个。ASPX后缀的文件名
<p />
<%
dim str1,str2 as string
str1=request.path.tolower()
str2=path.getfilenamewithoutextension(request.path)
response.write(str1 & "<p />" & str2)
%>


浙公网安备 33010602011771号