asp.net 4.0 在webconfig 设置 url映射

 

设置映射的路径 

    <urlMappings enabled="true">

      <add url="~/test.html" mappedUrl="~/Handler.ashx" />

    </urlMappings>


配置

<system.webServer>
        <handlers>
            <add name="html-Integrate" path="*.html" verb="GET,HEAD,POST,DEBUG" type="System.Web.UI.PageHandlerFactory" resourceType="Unspecified" preCondition="integratedMode" />
            <add name="htmlRequest" path="*.html" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness64" />
        </handlers>
    </system.webServer>


全部的webconfig

<configuration>
  <appSettings>
    <add key="ConStringEncrypt" value="false" />
    <add key="ConnectionString" value="server=127.0.0.1;database=codematic;uid=sa;pwd=1" />
  </appSettings>
  <system.web>    
    <compilation debug="true" targetFramework="4.0" />
    <urlMappings enabled="true">

      <add url="~/test.html" mappedUrl="~/Handler.ashx" />

    </urlMappings>
    
    <customErrors mode="On" defaultRedirect="res://ieframe.dll/http_404.html"></customErrors>
  </system.web>
    <system.webServer>
        <handlers>
            <add name="html-Integrate" path="*.html" verb="GET,HEAD,POST,DEBUG" type="System.Web.UI.PageHandlerFactory" resourceType="Unspecified" preCondition="integratedMode" />
            <add name="htmlRequest" path="*.html" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness64" />
        </handlers>
    </system.webServer>
</configuration>


这样就ok了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值