URLRewriter重写URL后ASPX的可以,HTML的:找不到网页
<?xml version= "1.0 " encoding= "gb2312 " ?>
<configuration xmlns= "http://schemas.microsoft.com/.NetConfiguration/v2.0 ">
<configSections>
<section name= "RewriterConfig " type= "URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter " />
</configSections>
<RewriterConfig>
<Rules>
<RewriterRule>
<LookFor> ~/web/default\.html </LookFor>
<SendTo> ~/web/default.aspx </SendTo>
</RewriterRule>
<RewriterRule>
<LookFor> ~/web/book-(\d{4})\.html </LookFor>
<SendTo> ~/web/detail.aspx?ID=$1 </SendTo>
</RewriterRule>
<RewriterRule>
<LookFor> ~/web/blog-(\d{4})\.html </LookFor>
<SendTo> ~/web/blogdetail.aspx?ID=$1 </SendTo>
</RewriterRule>
<RewriterRule>
<LookFor> ~/web/channel-(\d{4})\.html </LookFor>
<SendTo> ~/web/channel.aspx?segmentID=$1 </SendTo>
</RewriterRule>
<RewriterRule>
<LookFor> http://(.[a-z][A-Z][0-9]*)\.txtpub\.com/ </LookFor>
<SendTo> ~/web/space.aspx?userid=$1 </SendTo>
</RewriterRule>
</Rules>
</RewriterConfig>
<appSettings/>
<connectionStrings/>
<system.web>
<customErrors defaultRedirect= " " />
<httpModules>
<add type= "URLRewriter.ModuleRewriter, URLRewriter " name= "ModuleRewriter " />
</httpModules>
<!--
设置 compilation debug= "true " 将调试符号插入
已编译的页面中。但由于这会
影响性能,因此只在开发过程中将此值
设置为 true。
-->
<compilation debug= "true ">
<assemblies>
<add assembly= "System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A "/> </assemblies> </compilation>
<!--
通过 <authentication> 节可以配置 ASP.NET 使用的
安全身份验证模式,
以标识传入的用户。
-->
<authentication mode= "Windows "/>
<!--
如果在执行请求的过程中出现未处理的错误,
则通过 <customErrors> 节可以配置相应的处理步骤。具体说来,
开发人员通过该节可以配置
要显示的 html 错误页
以代替错误堆栈跟踪。
<customErrors mode= "RemoteOnly " defaultRedirect= "GenericErrorPage.htm ">
<error statusCode= "403 " redirect= "NoAccess.htm " />
<error statusCode= "404 " redirect= "FileNotFound.htm " />
</customErrors>
-->
</system.web>
</configuration>
[解决办法]
在IIS\你的站点\属性\主目录\配置\映谢 加入一个和 aspx 页面的配置相同的扩展名项。注意“确认文件是否存在”不要勾选,否则会出现找不到文件。
[解决办法]
楼上说是要添加一个映射
c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll
扩展名: .html
我试了为什么也是页面无法显示?