QA: 请求的内容似乎是脚本,因而将无法由静态文件处理程序来处理。

问题:

    在IIS7中布署Website时,运行时报如下提示:

!cid_image001_png@01CB4EB7

原因:

       根据本机环境,估计是因为映射所导致!

       先看本机环境(操作系统 原先是windows 2003 + IIS6 +vs2008 -->之后升级到 windows 2008 +IIS7 +vs2010\v2008共存)

       网站在做urlrewrite时,使用的是ISAPI Rewrite。

       然后在去查看IIS7 中  “处理程序映射

       !cid_image002_png@01CB4EB7

       结果发现确实有些问题。原先是注册为2.0变为1.1,而且少了一些映射。

       C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i

解决:

        if you are using v3 or the isapi rewrite you will need this rule:

        RewriteRule ^/(?!(?:manager|assets)/)(.*)\.html(?:\?(.*))?$ /index.php?q=$1?2&$2: [NC,L,U]

      或

         http://learn.iis.net/page.aspx/557/translate-htaccess-content-to-iis-webconfig/

      或者

          自动去更新映射缺少的部分

在web.config加上

ContractedBlock.gif ExpandedBlockStart.gif 代码
 
   
< handlers >
< add name ="AboMapperCustom-871336" path ="*.aspx" verb ="*" modules ="IsapiModule" scriptProcessor ="C:\Windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll" resourceType ="Unspecified" preCondition ="classicMode,runtimeVersionv2.0,bitness32" />
< add name ="AboMapperCustom-871334" path ="*.ashx" verb ="GET,HEAD,POST,DEBUG" modules ="IsapiModule" scriptProcessor ="C:\Windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll" resourceType ="Unspecified" requireAccess ="Script" preCondition ="classicMode,runtimeVersionv1.1,bitness32" responseBufferLimit ="0" />
</ handlers >

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值