Subdomain Removed From Redirect

I’m setting up a redirect in IIS and I’m having an issue with the subdomain disappearing. Here’s my code:

<rule name="MobDedect" stopProcessing="true">
    <match url=".*" ignoreCase="false" />
    <conditions logicalGrouping="MatchAll">
        <add input="{URL}" pattern="mobile" negate="true" />
            <add input="{HTTP_USER_AGENT}" pattern="midp|mobile|android|iphone|phone" />
            <add input="{HTTP_X-Device-User-Agent}" pattern="midp|mobile|android|iphone|phone" />
            <add input="{HTTP_X-OperaMini-Phone-UA}" pattern="midp|mobile|android|iphone|phone" />
          <action type="Rewrite" url="mobile/{R:0}" />

I want to change this: to this:

I can’t post more than 2 links to illustrate this, but with my code, the redirect goes directly to and removes the test subdomain.


Leave a Reply