简体   繁体   English

IIS URL重写 - 闪光物体小写出站规则条件/参数的URL

[英]IIS url rewrite - lowercase outbound rule condition for flash object/param urls

I have a.net 4.0 project and am using IIS 7.5 url rewrite rules to enforce lowercase on all urls - both inbound and outbound rules. 我有一个.net 4.0项目,正在使用IIS 7.5 url重写规则对所有url(入站和出站规则)强制使用小写字母。 I have everything functional as desired but for the case of an object param tag value being lowered: 我可以根据需要实现所有功能,但是对于对象参数标签值降低的情况:

    <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>

These urls for the flash server are indeed case sensitive and so modifying their case breaks functionality. 闪存服务器的这些URL确实区分大小写,因此修改其大小写中断功能。 How does one write a targeted condition to exclude these urls from being re-written? 如何编写一种有针对性的条件以排除这些URL被重写?

My web.config re-write outbound rules are as follows, i have tried to add custom tags to be able to match /object or param but to no avail: 我的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>

-my first stackoverflow post , please and thanks! -我的第一个stackoverflow帖子,请谢谢!

The rule should not contain object as you don't want it to match and get lowercased 规则不应包含对象,因为您不希望它匹配并变成小写

<match filterByTags="A, Script" pattern=".*[A-Z].*" ignoreCase="false" />

Start with this 从这个开始

    <outboundRules>
        <rule name="Outbound LowerCase Rule">
            <match filterByTags="A" pattern=".*[A-Z].*" />
            <action type="Rewrite" value="{ToLower:{R:0}}" />
        </rule>
    </outboundRules>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM