zoukankan      html  css  js  c++  java
  • Asp.Net IIS7.5伪静态设置

    注意:先要将应用池设置为集成模式,修改OK后,再改成经典模式。否则,什么托管程序出不来。

    1、新建网站,这里不做介绍,很简单。并把网站设置为集成模式

    2、添加通配符脚本映射

    打开之后显示如下界面,在右上角操作栏目内找到“添加通配符脚本映射”这一栏目

    我是64位系统就选择了64位的.net:C:WindowsMicrosoft.NETFramework64v2.0.50727aspnet_isapi.dll

    是32就选择32位:C:WindowsMicrosoft.NETFrameworkv2.0.50727aspnet_isapi.dll


    3、添加托管模块

    在右上角操作里选择添加托管模块,名称填写为all,类型改为 URLRewriter.ModuleRewriter勾选上下面仅针对asp。net应用程序或者是托管程序发出的请求调用:

    4、网站应用程序池改为经典模式

    5、web.config会自动生成以上设置的代码

        <system.webServer>
            <handlers>
                <add name="all" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:WindowsMicrosoft.NETFramework64v2.0.50727aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="classicMode,runtimeVersionv2.0,bitness64" />
            </handlers>
            <modules>
                <add name="all" type="URLRewriter.RewriterModule" preCondition="managedHandler" />
            </modules>
        </system.webServer>

    6、下边是iis6,iis7,iis7.5通用伪静态代码

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <!--伪静态开始-->
        <configSections>
            <section name="CustomConfiguration" type="URLRewriter.Config.UrlsSection, URLRewriter" />
        </configSections>
        <CustomConfiguration>
            <urls>
                <add virtualUrl="~/(w+).html" destinationUrl="~/ceshi.aspx" />
            </urls>
        </CustomConfiguration>
        <!--伪静态结束-->
        <system.web>
            <httpRuntime maxRequestLength="2097151" executionTimeout="3600" />
            <globalization requestEncoding="utf-8" responseEncoding="utf-8" fileEncoding="utf-8" />
            <compilation debug="true">
                <assemblies>
                    <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
                </assemblies>
            </compilation>
            <customErrors mode="Off" defaultRedirect="/404/404.htm"></customErrors>
            <!--伪静态开始-->
            <httpModules>
                <add type="URLRewriter.RewriterModule, URLRewriter" name="RewriterModule" />
            </httpModules>
            <!--伪静态结束-->
        </system.web>
        <!--IIS7.0   begin-->
        <system.webServer>
            <handlers>
                <add name="all" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:WindowsMicrosoft.NETFramework64v2.0.50727aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="classicMode,runtimeVersionv2.0,bitness64" />
            </handlers>
            <modules>
                <add name="all" type="URLRewriter.RewriterModule" preCondition="managedHandler" />
            </modules>
        </system.webServer>
        <!--IIS7.0   end-->
    </configuration>

    核心注意的地方:先要将应用池设置为集成模式,修改OK后,再改成经典模式。否则,什么托管程序出不来。剩下的按照这个模式操作就可以了

  • 相关阅读:
    map的集合顺序怎么跟添加时候的顺序一样
    陕西电信开出的电子发票没有发票代码
    微擎密码忘了,password.php也不起作用
    使用composer require安装服务后 切记使用composer install 安装一下才能用
    激活 山东理工大学 jetrbins
    SpringBoot打包成可执行jar
    卸载windows服务
    cglib的动态代理
    cglib的使用
    FCKeditor使用
  • 原文地址:https://www.cnblogs.com/webapi/p/6042106.html
Copyright © 2011-2022 走看看