简体   繁体   English

IIS重写移动检测

[英]IIS rewrite mobile detection

Okay, I'm trying to write a mobile detection/rewrite in IIS. 好的,我正在尝试在IIS中编写移动检测/重写。 If I take the conditions out, the rewrite functions. 如果我排除条件,则重写功能。 However, once I put the mobile detection bit in, it doesn't rewrite on mobile devices as intended (tested on an iphone and android). 但是,一旦将移动检测位放进去,它就不会按预期在移动设备上重写(在iphone和android上测试)。 Any advice here? 有什么建议吗? The regex used is from here: https://gist.github.com/dalethedeveloper/1503252 使用的正则表达式来自此处: https//gist.github.com/dalethedeveloper/1503252

<rule name="MobileDetect" patternSyntax="ExactMatch" stopProcessing="true">
        <match url="customer-support" ignoreCase="true" negate="true" />
            <conditions logicalGrouping="MatchAny">
            <add input="{HTTP_USER_AGENT}" pattern="Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune" />
        </conditions>
        <action type="Rewrite" url="mobile/customer-support" />
</rule>

Any help is greatly appreciated. 任何帮助是极大的赞赏。

问题在于patternSyntax需要设置为“ ECMAScript”

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

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