IIS6重写配置在IIS7中重写无效解决方案
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>