Created
January 28, 2016 11:25
-
-
Save restlessmedia/b619d6629d25e0d158cd to your computer and use it in GitHub Desktop.
.Net mobile rewrite rule
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<rewrite> | |
<rules> | |
<rule name="Mobile Rewrite" patternSyntax="ECMAScript" stopProcessing="true"> | |
<match url=".*" ignoreCase="true" negate="false" /> | |
<conditions logicalGrouping="MatchAny" trackAllCaptures="false"> | |
<add input="{HTTP_USER_AGENT}" pattern="midp|mobile|phone" /> | |
<add input="{HTTP_X-Device-User-Agent}" pattern="midp|mobile|phone" /> | |
<add input="{HTTP_X-OperaMini-Phone-UA}" pattern="midp|mobile|phone" /> | |
</conditions> | |
<action type="Redirect" url="http://localhost/mobile" appendQueryString="false" redirectType="Found" /> | |
</rule> | |
<!-- | |
<rule name="MobileRedirect" patternSyntax="ECMAScript" stopProcessing="true"> | |
<match url=".*" ignoreCase="true" /> | |
<conditions logicalGrouping="MatchAll"> | |
<add input="{HTTP_COOKIE}" pattern="nomobile" 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> | |
</rewrite> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment