码迷,mamicode.com
首页 > Web开发 > 详细

使用URLrewrite进行URL伪静态重写

时间:2015-10-25 22:52:48      阅读:344      评论:0      收藏:0      [点我收藏+]

标签:urlrerite.dll 伪静态


<?xml version="1.0" encoding="utf-8"?>


<!--
  有关如何配置 ASP.NET 应用程序的详细信息,请访问
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->


<configuration>


  <!--使用URLRewriter.dll -->
  <configSections>
    <section name="RewriterConfig" requirePermission="false" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
  </configSections>


  <appSettings>
    <add key="sqlConn" value="BjYLZtBk358Hbd023T4dVUzers8KD6g5TIG8hZSvYuWZMuFX3LbYEOMXoitRdRK1erqh7waKltA1rre4q5XgQLuQ==" />


  </appSettings>


  <RewriterConfig>
    <Rules>
      <RewriterRule>
        <LookFor>~/xueyuan/article/([0-9]*)</LookFor>
        <SendTo>~/xueyuan/article.aspx?id=$1</SendTo>
         </RewriterRule>
    <RewriterRule>
        <LookFor>~/xueyuan/C([0-9]*)</LookFor>
        <SendTo>~/xueyuan/articles.aspx?cid=$1</SendTo>
      </RewriterRule>
    <RewriterRule>
       
        <LookFor>~/xueyuan/P([0-9]*)</LookFor>
        <SendTo>~/xueyuan/articles.aspx?pid=$1</SendTo>
              </RewriterRule>
    </Rules>
  </RewriterConfig>


  <system.web>
    <httpHandlers>
    
      <!--使用URLRewriter.dll    -->
      <add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
      <add verb="*" path="*.html" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />


    </httpHandlers>
     <httpModules>
      <add type="URLRewriter.ModuleRewriter, URLRewriter" name="ModuleRewriter" />
    </httpModules>
    <!--<compilation debug="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />-->
    <compilation debug="true" targetFramework="4.0" />
    <httpRuntime requestValidationMode="2.0" />
    <customErrors mode="Off" />
  </system.web>


  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules>
      <remove name="ScriptModule" />
      <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </modules>
    <handlers>
      <remove name="WebServiceHandlerFactory-Integrated" />
      <remove name="ScriptHandlerFactory" />
      <remove name="ScriptHandlerFactoryAppServices" />
      <remove name="ScriptResource" />
           
            <add name="HTML" path="*.html" verb="GET,POST" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv4.0,bitness32" />
      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </handlers>
  </system.webServer>


</configuration>



本文出自 “Day Day Up” 博客,请务必保留此出处http://1433189426.blog.51cto.com/8055494/1706011

使用URLrewrite进行URL伪静态重写

标签:urlrerite.dll 伪静态

原文地址:http://1433189426.blog.51cto.com/8055494/1706011

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!