问题:
在IIS7中布署Website时,运行时报如下提示:
原因:
根据本机环境,估计是因为映射所导致!
先看本机环境(操作系统 原先是windows 2003 + IIS6 +vs2008 -->之后升级到 windows 2008 +IIS7 +vs2010\v2008共存)
网站在做urlrewrite时,使用的是ISAPI Rewrite。
然后在去查看IIS7 中 “处理程序映射”
结果发现确实有些问题。原先是注册为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加上
代码
< 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 >
本文介绍了解决IIS7中部署网站时出现的问题,特别是关于URL重写配置和处理程序映射的问题。通过调整web.config文件中的设置来确保正确的版本映射,并提供了具体的代码示例。



5869

被折叠的 条评论
为什么被折叠?



