【发布时间】:2021-12-06 11:04:03
【问题描述】:
在我的 IIS 应用程序中有一个内部 url,如果用户通过移动设备浏览,我想重定向客户端。
我尝试了以下 URL 重写规则,它会重定向部分,但也会导致重定向循环过多。
<rule name="Mobile Rewrite" patternSyntax="ECMAScript" stopProcessing="true">
<match url="(.*)" negate="false" />
<conditions logicalGrouping="MatchAny" trackAllCaptures="true">
<add input="{HTTP_USER_AGENT}" pattern="(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino" />
<add input="{URL}" pattern=".*MMEducation/ScreenEdRegistration" negate="true" />
</conditions>
<action type="Redirect" url="MMEducation/ScreenEdRegistration" appendQueryString="false" redirectType="Found" />
</rule>
谁能建议我如何用重写规则解决这个问题?
【问题讨论】:
标签: iis url-rewriting