您现在的位置: 万盛学电脑网 >> 程序编程 >> 网络编程 >> asp.net编程 >> 正文

asp.net页面弄成伪静态页面

作者:佚名    责任编辑:admin    更新时间:2022-06-22

 在Web.config中写:

<RewriterConfig>
<Rules>

<RewriterRule>
<LookFor>~/index.html</LookFor> //索要更改的页面
<SendTo>~/index.aspx</SendTo> //没有参数的情况下
</RewriterRule>

<RewriterRule>
<LookFor>~/Help/newPro(d*).html</LookFor> // (d*) 表示参数
<SendTo>~/Help/newPro.aspx?pNum=$1</SendTo> //有一个参数的情况下
</RewriterRule>


<RewriterRule>
<LookFor>~/Help/AboutJiangHujia(d*)_(d*).html</LookFor> 
<SendTo><![CDATA[~/Help/AboutJiangHujia.aspx?sid=$1&cid=$2]]></SendTo> //有多个参数的情况下
</RewriterRule>

</Rules>
</RewriterConfig>
这样一个伪静态的也面就能链接了