欢迎来到HELLO素材网! 南京网站制作选择顺炫科技
丰富的DIV CSS模版、JS,jQuery特效免费提供下载
当前位置:主页 > 建站教程 > 服务器教程 >

IIS6重写配置在IIS7中重写无效解决方案

发表于2017-11-24 11:43| 次阅读| 来源网络整理| 作者session

摘要:IIS6重写配置在IIS7中重写无效解决方案由于IIS6只能在请求被分配到Asp.Net引擎后才能发生重写操作,IIS7可以在IIS请求管

 IIS6重写配置在IIS7中重写无效解决方案由于IIS6只能在请求被分配到Asp.Net引擎后才能发生重写操作,IIS7可以在IIS请求管道的任何地方执行一个HttpModule,

 而且IIS7对于文件或文件夹的访问权限得重新设置.

 以下是错误信息:

 Theresourcecannotbefound.

 Description:HTTP404.Theresourceyouarelookingfor(oroneofitsdependencies)couldhavebeenremoved,haditsnamechanged,oristemporarilyunavailable.PleasereviewthefollowingURLandmakesurethatitisspelledcorrectly.

 RequestedURL:/signin.aspx

 如果是IIS7.0的运行环境,添加该配置

 <system.webServer>

 <modules>

 <!--您的自定义IIS重写模块操作-->

 <addtype="S.Sams.Framework.UrlRewriter.RewriterModule"name="RewriterModule"/>

 </modules>

 </system.webServer>

 问题即可解决!

 摘引自ScottGu的Blog

 <?xmlversion="1.0"encoding="UTF-8"?>

 <configuration>

 <configSections>

 <sectionname="rewriter"

 requirePermission="false"

 type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler,Intelligencia.UrlRewriter"/>

 </configSections>

 <system.web>

 <httpModules>

 <addname="UrlRewriter"type="Intelligencia.UrlRewriter.RewriterHttpModule,Intelligencia.UrlRewriter"/>

 </httpModules>

 </system.web>

 <system.webServer>

 <modulesrunAllManagedModulesForAllRequests="true">

 <addname="UrlRewriter"type="Intelligencia.UrlRewriter.RewriterHttpModule"/>

 </modules>

 <validationvalidateIntegratedModeConfiguration="false"/>

 </system.webServer>

 <rewriter>

 <rewriteurl="~/products/(.+)"to="~/products.aspx?category=$1"/>

 </rewriter>

 </configuration>