【发布时间】:2011-07-15 06:51:21
【问题描述】:
我有一个 .net 4.0 项目,并且正在使用 IIS 7.5 url 重写规则对所有 url 强制小写 - 入站和出站规则。我有一切功能,但对象参数标记值被降低:
<object width="600" height="378" id="flash_258112502" type="application/x-shockwave-flash" data="/_resources/flash/videoplayer.swf">
<param value="rtmp://media.website.org/vod/mp4:20110302councilmeeting.f4v" name="serverurl">
</object>
Flash 服务器的这些 url 确实区分大小写,因此修改了它们的大小写功能。如何编写一个有针对性的条件来排除这些 url 被重写?
我的web.config重写出站规则如下,我尝试添加自定义标签以匹配/object或param但无济于事:
<outboundRules rewriteBeforeCache="true">
<!-- convert all links to lowercase -->
<rule name="Outbound lowercase" preCondition="IsHTML" enabled="true">
<match filterByTags="A, Script, CustomTags" customTags="object" pattern=".*[A-Z].*" ignoreCase="false" />
<action type="Rewrite" value="{ToLower:{R:0}}" />
<conditions logicalGrouping="MatchAny">
<add input="{URL}" pattern="/workarea/" negate="true" />
<add input="{URL}" pattern="media.website.org" negate="true" />
<add input="{URL}" pattern="^.*\.(ashx|axd|css|gif|png|js|flv|f4v)$" negate="true" />
</conditions>
</rule>
<preConditions>
<!-- Only process html files -->
<preCondition name="IsHTML" logicalGrouping="MatchAny">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
</preConditions>
<customTags>
<tags name="param">
<tag name="param" attribute="param" />
</tags>
<tags name="object" />
</customTags>
</outboundRules>
-我的第一篇 stackoverflow 帖子,谢谢!
【问题讨论】:
标签: .net iis url-rewriting