asp.net如何实现伪静态?(URLRewriter)
<?xml version="1.0"?>
<!--
有关如何配置 ASP.NET 应用程序的详细信息,请访问
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<configSections>
<section name ="RewriterConfig" type ="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter"/>
</configSections>
<RewriterConfig>
<Rules>
<RewriterRule>
<LookFor>~/(.[0-9]*).html</LookFor>
<SendTo>~/test.aspx?id=$1</SendTo>
</RewriterRule>
</Rules>
</RewriterConfig>
<appSettings>
<add key="c" value="" />
<add key="S" value="" />
</appSettings>
<system.web>
<httpHandlers>
<remove verb ="*" path ="*.asmx"/>
<add verb ="*" path ="*.aspx" type ="URLRewriter.RewriterFactoryHandler, URLRewriter" />
<add verb ="*" path ="*.html" type ="URLRewriter.RewriterFactoryHandler, URLRewriter" />
</httpHandlers>
<httpModules>
<add name ="ScriptModule" type ="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</httpModules>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Management, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
</assemblies>
</compilation>
</system.web>
</configuration>
asp.net html 伪静态 URLRewriter
[解决办法]
仔细看下规则路径是否正确
[解决办法]
经典模式下加上下面这段:
<configuration>
...
<system.webserver>
<handlers>
<add name="ASPNET" path="*.html" verb="*" modules="IsapiModule"
scriptprocessor="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll"
resourcetype="Unspecified" requireaccess="None" precondition="classicMode,runtimeVersionv4.0,bitness64">
</add>
</handlers>
</system.webserver>
...
</configuration>