双11狂欢大促

盲盒赢 定制羽绒服

开启惊喜盲盒,抽取你的专属好礼

— 惊喜奖品抢先看 —

asp.net如何实现伪静态?(URLRewriter)

爱在今世 爱在今世 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
<?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>

这是我的web.config里面的设置。
IIS是8.0(但是感觉和7.5一样)
模式已经改成经典模式
在处理程序映射里面已经添加脚本映射*.html,可执行文件是C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll
已经添加了通配符脚本映射* ,可执行文件同上。按照网上别人的说法,如此就可以了。
但是我输入localhost/5.html时出现
...全文
评论 8
收藏 已收藏
分享
返回顶部
爱在今世
.NET社区 62,274 成员 668,968 内容