I am trying to figure out how to add a rule to my web.config so it detects any link that has anything in the url beyond the .com portion - and then does not process the next input condition which detects if the device is mobile and then redirects to m.mysite.com.
For example here are some example cases I would want it to skip over the mobile redirect:
- If a incoming link is www.mysite.com/coupon/etc
- If a incoming link is www.mysite.com?c=1
I do want it to redirect to the mobile site in all cases where its just the base domain of www.mysite.com or mysite.com.
Here is my current web.config rewrite section.
<rewrite>
<rules>
<rule name="MobileRedirect" patternSyntax="ECMAScript" stopProcessing="true">
<match url=".*" ignoreCase="true"/>
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_COOKIE}" pattern="persistdesktop=1" ignoreCase="true" negate="true"/>
<add input="{HTTP_USER_AGENT}" pattern="android|blackberry|googlebot-mobile|iemobile|iphone|ipod|opera mobile|palmos|webos"/>
</conditions>
<action type="Redirect" url="http://m.mysite.com" appendQueryString="false" redirectType="Found"/>
</rule>
</rules>
So my best guess is that I need to add another condition above the other two. And then do I change the conditions logicalGrouping parameter to MatchAny? Or do I create another rule above this existing rule? Thanks!