网站使用了UrlRewriter.dll伪静态,iis需要配置哪些地方

来源:互联网 发布:为知笔记 编辑:程序博客网 时间:2024/06/08 15:34

 

 

1、.net程序里面需要引用文件Intelligencia.UrlRewriter

2、Web.config里面进行配置,大致如下:

<configuration>
<configSections>
  <section name="rewriter" requirePermission="false" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter"/>
 </configSections>

<rewriter>
  <!--pages-->
  <rewrite url="^~/Pages/(/w+).html" to="~/Pages/$1.aspx" processing="stop"/>
 </rewriter>
 <system.web>
<httpModules>
   <add type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter" name="UrlRewriter"/>
   <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
  </httpModules>

<httpHandlers>

<add verb="*" path="*.aspx"  type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter" />

</httpHandlers>


 </system.web>
</configuration>

3、IIS配置,需要配置两个地方
       选择站点->属性->主目录->配置->这里需要配置两个地方
      1、应用程序扩展->添加->
                可执行文件:C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/aspnet_isapi.dll
               扩展名.html
              确定文件是否存在,前面勾去掉
      2、通配符应用程序映射里面插入,C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/aspnet_isapi.dll
            确定文件是否存在,前面勾去掉

到此全部完成