帮助中心 >  技术知识库 >  网站相关 >  建站知识 >  Windows2008系统IIS7下aspnet_isapi.dll设置.net程序实现伪静态

Windows2008系统IIS7下aspnet_isapi.dll设置.net程序实现伪静态

2015-11-06 13:55:48 3340

首先我们需要调用用URLRewriter控件

一、首先要有这个文件URLRewriter.dll,并将其放到下面的网站bin目录里面,并且将其引用添加到下面里面。

下载地址:download.microsoft.com/download/0/4/6/0463611e-a3f9-490d-a08c-877a83b797cf/MSDNURLRewriting.msi

二、下面就是Web.Config文件的配置了,配置过程相当简单。

      1、先添加这个

    <configSections>

      <section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />

<!-- “这里就是URLRewriter控件调用”-->

    </configSections>

    <RewriterConfig>

         <Rules>

               <!-- Rules for Blog Content Displayer -->

             <RewriterRule>

               <LookFor>~/index.html</LookFor>        
                       <SendTo>~/default.aspx</SendTo>    

<!-- "<LookFor>里面为配置后的地址,<SendTo>才是真正访问的地址"-->

            </RewriterRule>

        </Rules>

  </RewriterConfig>

这里的意思是将default.aspx转换成index.html的形式输出,就好比我是打开www.landui.com/default.aspx的首页,但是在浏览的时候显示的却是www.landui.com/index.html这样的转换过程。

2、再添加这个

 <system.webServer>
         <validation validateIntegratedModeConfiguration="false" />  

     <!--"这个主要作用是设置不检测 <system.web>中的配置" -->
         <handlers>
                <add name="aspnet2" path="*" verb="*" modules="IsapiModule" 

           scriptProcessor="C:WindowsMicrosoft.NETFrameworkv4.0.30319

           aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None"

           preCondition="classicMode,runtimeVersionv4.0,bitness32" />

           <add name="html2" path="*.html" verb="*" modules="IsapiModule" 

           scriptProcessor="C:WindowsMicrosoft.NETFrameworkv4.0.30319

           aspnet_isapi.dll" resourceType="Unspecified"preCondition=

           "classicMode,runtimeVersionv4.0,bitness32" />

        </handlers>
     </system.webServer>
       这一步可以在IIS中找到自己的虚拟目录网站,点击处理程序映射,然后点添加通配符脚本映射,然后弹出的对话框中添加的可执行文件路径为:c:windowsmicrosoft.netframeworkv2.0.50727aspnet_isapi.dll。



保存就会在web.conf文件中生成上述代码。这下打开网址尝试就可以查看到。


提交成功!非常感谢您的反馈,我们会继续努力做到更好!

这条文档是否有帮助解决问题?

非常抱歉未能帮助到您。为了给您提供更好的服务,我们很需要您进一步的反馈信息:

在文档使用中是否遇到以下问题: