先在项目里面引用这个
然后配置web.config
configuration中加上
<configSections>
<section name="CustomConfiguration" type="URLRewriter.Config.UrlsSection, URLRewriter"/>
</configSections>
system.web加上
<httpModules>
<add type="URLRewriter.RewriterModule, URLRewriter" name="RewriterModule"/>
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
</httpModules>
system.webServer加上
<modules runAllManagedModulesForAllRequests="true">
<add name="URLRewriter" type="URLRewriter.RewriterModule" preCondition="managedHandler"/>
</modules>
最后在configuration末尾加上
<CustomConfiguration>
<urls>
<add virtualUrl="~/saoyisao/SF" destinationUrl="~/Web/CreateOE_SF"/>
</urls>
</CustomConfiguration>
destinationUrl表示原本的url
virtualUrl是自定义url