You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用IIS Rewrite模块为PDF添加Canonical URL失败,求解决方案

IIS Rewrite模块为PDF添加Canonical URL无效问题

我尝试仅使用IIS Rewrite模块为PDF文件添加Canonical URL,但配置后无法生效。预期要生成的响应头如下:

Link: <http://www.example.com/downloads/whitepaper.pdf>; rel="canonical"

当前使用的XML配置

<outboundRules rewriteBeforeCache="true">
<rule name="Canonical For PDF" preCondition="IsPDF">
                    <match serverVariable="RESPONSE_Link" pattern=".*" negate="false" />
                    <conditions>
                    </conditions>
                    <action type="Rewrite" value="&lt;{HTTP_HOST}{REQUEST_URI}&gt;; rel=&quot;canonical&quot;" />
                </rule>
                <preConditions>
                    <preCondition name="IsPDF">
                        <add input="{REQUEST_FILENAME}" pattern="\.pdf.*" />
                    </preCondition>
                </preConditions>
      </outboundRules>

内容的提问来源于stack exchange,提问作者Mike Flynn

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.05 20:34:53