IIS7.5 伪静态 web.config 配置方法

  iis 7.5

 

     1)首先新建一个应用程序池,名称任意,比如:nettest,托管管道模式先暂时设置为集成模式,等下面的一系列设置完成之后再设置成经典模式;
     2)部署好站点,并将此站点的应用程序池设置为nettest;
     3)选中站点,切换到功能试图,找到 "服务器组件"-> "处理程序映射",双击之后,在打开窗口右侧的操作栏目下做如下设置:
     4)"添加脚本映射":请求路径 .html ,可执行文件选择 C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll ,如果是4.0,则为C:\Windows\Microsoft.NET\Framework\v4.0.30319 \aspnet_isapi.dll,名称随意;
     5)"添加通配符脚本映射":请求路径 * ,可执行文件为:C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,名称随意;
     6)"添加托管处理程序":请求路径 * ,可执行文件:System.Web.UI.PageHandlerFactory,名称随意;
     7)打开站点切换到功能试图,找到 "服务器组件"->"模块",双击之后,在打开窗口右侧的操作栏目中,点击"添加托管模块",类型URLRewriter.ModuleRewriter,并且把"仅针对向asp.net 应用程序或托管处理程序发出请求调用" 选中;

     8)最后,找到我们第一步建立的应用程序池nettest,将托管管道模式设置为经典模式。

(如果为.net4.0,有可能要注册.net4.0)

web.config

 

<RewriterConfig>
    <Rules>
      <RewriterRule>
        <LookFor>~/qqqq/ccccc-(\d+)-(\d+).htm</LookFor>
        <SendTo>~/xxx/xxxx/Default.aspx?aid=$1&amp;bid=$2</SendTo>
      </RewriterRule>
    </Rules>
</RewriterConfig>

 

  <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <handlers>
      <remove name="SimpleHandlerFactory-ISAPI-4.0_64bit"/>
      <add name="SimpleHandlerFactory-ISAPI-4.0_64bit" path="*.htm" 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,runtimeVersionv4.0,bitness64" responseBufferLimit="0"/>
    </handlers>
    <modules>
      <add name="URLRewriter" type="URLRewriter.ModuleRewriter" preCondition="managedHandler"/>
    </modules>
  </system.webServer>

posted @ 2015-01-27 11:35  狄枫  阅读(511)  评论(0编辑  收藏  举报