zoukankan      html  css  js  c++  java
  • iis6|iis7|配置URLRewriter|64位操作系统下|.net2.0|.net4.0|配置URLRewriter|Web.config配置详情

    想必很多ASP.NET的码友们在IIS配置伪静态被严重纠结过不止一次两次,本园主经过多次站点伪静态配置,总结了一下,IIS版本:IIS 6、IIS 7,服务器:Windows Server 2003、Windows Server 2008,开发机多半是Windows 7,站点.NET Framework 2.0、.NET Framework 4.0 ,随机搭配任意组合,时行时不行,完全靠运气以及人品,被虐千百遍之后,真是刻苦铭心闻者伤心见者也会流泪...

    简单粗暴点吧,我认为直接帖上Web.config文件最实在

    <?xml version="1.0"?>
    <configuration>
      <configSections>
        <section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter"/>
      </configSections>
      <RewriterConfig>
        <Rules>
          <RewriterRule>
            <LookFor>~/(w*).html</LookFor>
            <SendTo>~/Default.aspx?id=$1</SendTo>
          </RewriterRule>
          <RewriterRule>
            <LookFor>~/news-(w*)_(w*).html</LookFor>
            <SendTo>~/Default.aspx?id=$1&amp;tt=$2</SendTo>
          </RewriterRule>
        </Rules>
      </RewriterConfig>
      <system.web>
        <!--<compilation debug="true" targetFramework="2.0" />-->
        <httpHandlers>
          <add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter"/>
          <add verb="*" path="*.html" type="URLRewriter.RewriterFactoryHandler, URLRewriter"/>
        </httpHandlers>
      </system.web>
      <system.webServer>
        <handlers>
    
            <!--.NET Framework 2.0 或 .NET Framework 4.0 二选一 -->
            <!--.NET Framework 2.0 用这-->
            <add name="woool1" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:WindowsMicrosoft.NETFrameworkv2.0.50727aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="classicMode,runtimeVersionv4.0,bitness32"/>
            <add name="woool" path="*.html" verb="*" modules="IsapiModule" scriptProcessor="C:WindowsMicrosoft.NETFrameworkv2.0.50727aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness32"/>
            <!--64位操作系统就加上 ? -->
            <add name="woool1_64" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:WindowsMicrosoft.NETFramework64v2.0.50727aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="classicMode,runtimeVersionv4.0,bitness32"/>
            <add name="woool_64" path="*.html" verb="*" modules="IsapiModule" scriptProcessor="C:WindowsMicrosoft.NETFramework64v2.0.50727aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness32"/>
            <!--.NET Framework 2.0 用这结束-->
            
            <!--.NET Framework 4.0 用这开始-->
            <add name="woool1" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:WindowsMicrosoft.NETFrameworkv4.0.30319aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="classicMode,runtimeVersionv4.0,bitness32"/>
            <add name="woool" path="*.html" verb="*" modules="IsapiModule" scriptProcessor="C:WindowsMicrosoft.NETFrameworkv4.0.30319aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness32"/>
            <!--64位操作系统就加上 ? -->
            <add name="woool1_64" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="classicMode,runtimeVersionv4.0,bitness32"/>
            <add name="woool_64" path="*.html" verb="*" modules="IsapiModule" scriptProcessor="C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness32"/>
            <!--.NET Framework 4.0 用这结束-->
            
        </handlers>
        <!--iis 7.0 下支持 URLRewriter ? -->
        <modules>
          <add name="ModuleRewriter" type="URLRewriter.ModuleRewriter, URLRewriter"/>
        </modules>
      </system.webServer>
    </configuration>

    下载例子URLRewriter.dll

  • 相关阅读:
    java反射详解 (转至 http://www.cnblogs.com/rollenholt/archive/2011/09/02/2163758.html)
    DexClassLoader
    防止 apk反编译 jocky-- java混淆代码 (转至:http://my.oschina.net/f839903061/blog/72554)
    Android APK反编译详解(附图) (转至 http://blog.csdn.net/ithomer/article/details/6727581)
    双卡手机怎么指定SIM卡打电话
    android设备休眠
    GSON使用笔记(3) -- 如何反序列化出List
    Notepad++ 更换主题
    如何才能成为一个成功的项目经理
    项目经理是干出来的,不是学出来的;是带出来的,不是教出来的
  • 原文地址:https://www.cnblogs.com/yonsy/p/5072529.html
Copyright © 2011-2022 走看看