0

根据这个答案,为了将移动用户重定向到移动站点,您应该添加 HTTP 标头-

Vary: user-agent

我正在使用 IIS URL Rewrite 模块,具有这样的规则-

<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>

我将如何vary在此响应中设置标题?

4

0 回答 0