下面的url重写规则怎么理解

来源:百度知道 编辑:UC知道 时间:2024/05/20 20:15:16
<RewriterRule>
<LookFor>~/wjTrade_(.[0-9]*)\.html</LookFor>
<SendTo>~/wjTrade.aspx?Menu_ID=$1</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/wjNews_View_(.[0-9]*)\.html</LookFor>
<SendTo>~/wjNews_View.aspx?n_ID=$1</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/wjNews_Class_(.[0-9]*)\.html</LookFor>
<SendTo>~/wjNews_Class.aspx?Big_Id=$1</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/wjNews_Class_(\d{1,6})_(\d{1,6})\.html</LookFor>
<SendTo>~/wjNews_Class.aspx?page=$1&Big_Id=$2</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/wjNews_list_(\d{1,6})\.html</LookFor>
<SendTo>~/wjNews_list.aspx?page=$1</SendTo>
<

将【~/wjTrade_(.[0-9]*)\.html】地址重写为【~/wjTrade.aspx?Menu_ID=$1】地址($1替换为(.[0-9]*)代表的数字),以下类似,如:

~/wjTrade_2302.html
将会被重写为:
~/wjTrade.aspx?Menu_ID=2302

都是正则表达式,用百度搜下正则表达式的使用,花个一个小时你就看得懂了