0

According to this answer, for redirecting a mobile user to a mobile site you should add the HTTP header-

Vary: user-agent

I'm using IIS URL Rewrite module, with a rule like this-

<rule name="Production Mobile Rewrite 1" patternSyntax="ECMAScript" stopProcessing="true">
    <match url="(.*)" ignoreCase="true" negate="false" />
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
        <add input="{HTTP_USER_AGENT}" pattern="midp|mobile|phone" />
        <add input="{HTTP_HOST}" pattern="^www.example.com$" />
    </conditions>
    <action type="Redirect" url="http://m.example.com/{R:1}" appendQueryString="false" redirectType="Found" />
</rule>

How would I set the vary header in this response?

Community
  • 1
  • 1
Spongeboy
  • 2,232
  • 3
  • 28
  • 37
  • I think you don't need to do so. – Satpal May 16 '13 at 05:51
  • Google strongly recommends that the Vary HTTP header is added. The "why" of this is covered by the linked to question. This question is asking "how" to implement this in IIS URL Rewrite. – Spongeboy May 19 '13 at 23:39

0 Answers0