asp.net 1.1中url重写的问题(2)

2008-02-22 09:31:50来源:互联网 阅读 ()

新老客户大回馈,云服务器低至5折


cxt.RewritePath(newUrl);



}
//else
//{
// cxt.Response.Write(cxt.Request.Path "<BR>");
// cxt.Response.Write("你请求的资源不存在或无权访问!");
// cxt.Response.Flush();
// cxt.Response.End();
//}
}
}
public void Dispose()
{
// TODO: 添加 ReWriteModule.Dispose 实现
}

#endregion
}

---------rule.xml的配置如下:

<?xml version="1.0" encoding="utf-8" ?>
<Rules>
<RewriterRule>
<LookFors>
<LookFor>~/(\d{4})/(\d{2})\.html</LookFor>
<LookFor>~/(\d{4})/(\d{2})/</LookFor>
<LookFor>~/(\d{4})/(\d{2})</LookFor>
<LookFor>~/(\d{4})/(\d{2})/index.html</LookFor>
</LookFors>
<SendTo>~/Pro.aspx?year=$1&amp;month=$2</SendTo>
</RewriterRule>
<RewriterRule>
<LookFors>
<LookFor>~/Pro.aspx?year=(\d{4})&amp;month=(\d{2})</LookFor>
</LookFors>
<SendTo>~/(\d{4})/(\d{2})\.html</SendTo>
</RewriterRule>
<RewriterRule>
<LookFors>
<LookFor>~/pc</LookFor>
</LookFors>
<SendTo>~/Test2.aspx</SendTo>
</RewriterRule>
<RewriterRule>
<LookFors>
<LookFor>~/index.html</LookFor>
<LookFor>~/default.html</LookFor>
</LookFors>
<SendTo>~/default.aspx</SendTo>
</RewriterRule>
</Rules>

/////////对于因重写引起的action的改变,请参考本人写的asp.net2.0中的urlMappings的问题!!!!!

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:随机得到Access数据库记录

下一篇:一段获得网卡地址的代码,可以用来做软件许可证用.