asp.net重写静态页面地址的使用

asp.net重写静态页面地址的使用

web.config的使用

1.

<configSections>
<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
</configSections>
<RewriterConfig>
<Rules>
<RewriterRule>
<LookFor>~/(\d+).htmls</LookFor>
<SendTo>~/Default.aspx?cn=$1</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/Default_(\d+).jsp</LookFor>
<SendTo>~/Default.aspx?cn=$1</SendTo>
</RewriterRule>
</Rules>
</RewriterConfig>
<system.web>

<httpModules>
<add type="URLRewriter.ModuleRewriter, URLRewriter" name="ModuleRewriter" />
</httpModules>

2.在iis中加缓存isapi扩展

点掉确认文件是否存在

你可能感兴趣的:(.net,Web,asp.net,asp,IIS)