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

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

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

以下是错误信息:

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

Requested URL: /signin.aspx



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

<system.webServer>
<modules>
<!-- 您的自定义IIS重写模块操作--> 
    <add type="S.Sams.Framework.UrlRewriter.RewriterModule" name="RewriterModule" />
</modules>
</system.webServer>

问题即可解决!

摘引自ScottGu的Blog
<?xml version="1.0" encoding="UTF-8"?>

<configuration>

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

<system.web>

<httpModules>
<add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter" />
</httpModules>

  </system.web>

<system.webServer>

<modules runAllManagedModulesForAllRequests="true">
<add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule" />
</modules>

<validation validateIntegratedModeConfiguration="false" />

</system.webServer>

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

</configuration>


 

    -- S.Sams Lifexperience!
posted @ 2008-04-12 14:51 S.Sams 阅读(1426) 评论(3)  编辑 收藏

  回复  引用  查看    
#1楼  2008-04-12 23:19 | 簡簡單單..      
Mark
  回复  引用  查看    
#2楼  2008-04-13 10:46 | 菜无罪      
mark
  回复  引用  查看    
#3楼  2008-04-14 09:29 | 福星人      
mark

标题  
姓名  
主页
Email (博主才能看到) 
验证码 *  看不清,换一张 [登录][注册]
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      
该文被作者在 2008-04-12 22:02 编辑过


相关链接: