url重写web.config配置

<?xml version="1.0" encoding="UTF-8"?>
<!--
    注意: 除了手动编辑此文件以外,您还可以使用
    Web 管理工具来配置应用程序的设置。可以使用 Visual Studio 中的
     “网站”->“Asp.Net 配置”选项。
    设置和注释的完整列表在
    machine.config.comments 中,该文件通常位于
    \Windows\Microsoft.Net\Framework\v2.x\Config 中
-->
<configuration>

  <configSections>
    <section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
  </configSections>

  <RewriterConfig>
    <Rules>      
      <!-- Rules for Blog Content Displayer -->
      <RewriterRule>
        <LookFor>~/index.htm</LookFor>
        <SendTo>~/index.aspx</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/contact/contactus.htm</LookFor>
        <SendTo>~/contact/contact.aspx</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/contact/job.htm</LookFor>
        <SendTo>~/contact/joblist.aspx</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/contact/map.htm</LookFor>
        <SendTo>~/contact/sitemap.aspx</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/customer/importantlist.htm</LookFor>
        <SendTo>~/customer/important.aspx</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/customer/importantlist_(.[0-9]*)\.htm</LookFor>
        <SendTo>~/customer/important.aspx?page=$1</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/customer/caselist.htm</LookFor>
        <SendTo>~/customer/worklist.aspx</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/customer/caselist_(.[0-9]*)\.htm</LookFor>
        <SendTo>~/customer/worklist.aspx?page=$1</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/customer/viedolist.htm</LookFor>
        <SendTo>~/customer/workviedo.aspx</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/customer/viedolist_(.[0-9]*)\.htm</LookFor>
        <SendTo>~/customer/workviedo.aspx?page=$1</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/customer/show_(.[0-9]*)\.htm</LookFor>
        <SendTo>~/customer/workshow.aspx?Sid=$1</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/about/about.htm</LookFor>
        <SendTo>~/about/about.aspx</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/about/concept.htm</LookFor>
        <SendTo>~/about/concept.aspx</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/about/tuandui.htm</LookFor>
        <SendTo>~/about/tuandui.aspx</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/about/opinion.htm</LookFor>
        <SendTo>~/about/opinion.aspx</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/about/honor.htm</LookFor>
        <SendTo>~/about/honor.aspx</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/service/huiyi.htm</LookFor>
        <SendTo>~/service/service.aspx?Sid=8</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/service/yanchu.htm</LookFor>
        <SendTo>~/service/service.aspx?Sid=9</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/service/gongguan.htm</LookFor>
        <SendTo>~/service/service.aspx?Sid=10</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/service/qingdian.htm</LookFor>
        <SendTo>~/service/service.aspx?Sid=11</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/service/meiti.htm</LookFor>
        <SendTo>~/service/service.aspx?Sid=12</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/service/huizhan.htm</LookFor>
        <SendTo>~/service/service.aspx?Sid=13</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/service/yingshi.htm</LookFor>
        <SendTo>~/service/service.aspx?Sid=14</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/service/jiudian.htm</LookFor>
        <SendTo>~/service/service.aspx?Sid=15</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/service/qita.htm</LookFor>
        <SendTo>~/service/service.aspx?Sid=16</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/service/index.htm</LookFor>
        <SendTo>~/service/index.aspx</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/service/howto.htm</LookFor>
        <SendTo>~/service/howto.aspx</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/news/list_(.[0-9]*)_(.[0-9]*)\.htm</LookFor>
        <SendTo>~/news/newslist.aspx?tid=$1&amp;page=$2</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/news/list_(.[0-9]*)\.htm</LookFor>
        <SendTo>~/news/newslist.aspx?tid=$1</SendTo>
      </RewriterRule>
      <!--Rules for News view -->
      <RewriterRule>
        <LookFor>~/news/show_(.[0-9]*)_(.[0-9]*)\.htm</LookFor>
        <SendTo>~/news/newsshow.aspx?Sid=$1&amp;tid=$2</SendTo>
      </RewriterRule>
    </Rules>
  </RewriterConfig>

  <appSettings>
    <add key="AccessWeb" value="~/App_Data/%7alomste#$@skjs.mdb" />
    <add key="domainUrl" value="http://192.168.1.70:3006" />
    <add key="PagingBarStyle" value="quotes" />
  </appSettings>
  <connectionStrings />
  <system.web>
    <!--
            设置 compilation debug="true" 将调试符号插入
            已编译的页面中。但由于这会
            影响性能,因此只在开发过程中将此值
            设置为 true。
        -->
    <compilation debug="true">
      <assemblies>
        <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        
      </assemblies>
       <buildProviders>
        <add extension=".html" type="System.Web.Compilation.PageBuildProvider" />
      </buildProviders>    
    </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>
        -->
    <httpHandlers>
      <add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
      <add verb="*" path="*.htm" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
      <add verb="*" path="*.html" type="System.Web.UI.PageHandlerFactory"/>
    </httpHandlers>

  <customErrors mode="Off"/>
  </system.web>
 
    <system.webServer>
        <handlers>
            <add name="HttpUrlRewriter-2.0" path=".html" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness32" />
        </handlers>        
    </system.webServer>
    
    <!-- Web.Config 配置文件 -->


</configuration>

posted @ 2013-01-07 10:14  王涛1  阅读(1302)  评论(0编辑  收藏  举报