【问题标题】:Pdf to Pdf redirect rules not working in web.configPdf 到 Pdf 重定向规则在 web.config 中不起作用
【发布时间】:2020-03-30 10:13:12
【问题描述】:
我尝试按照 web.config 中的规则将 pdf 重定向到 pdf
<rule name="r_1" stopProcessing="true">
<match url="^/media/peedin5t/xxx.pdf$" ignoreCase="false" />
<action type="Redirect" url="/media/beebz4yx/xxx1.pdf" redirectType="Permanent" />
</rule>
即使我清除了缓存仍然无法正常工作
【问题讨论】:
标签:
asp.net-mvc
iis
web-config
iis-8.5
umbraco8
【解决方案1】:
这条规则对我来说很好,请将 ^/media/peedin5t/xxx.pdf$ 修改为 ^media/peedin5t/xxx.pdf$。
<rule name="r_1" stopProcessing="true">
<match url="^media/peedin5t/xxx.pdf$" ignoreCase="false" />
<action type="Redirect" url="/media/beebz4yx/xxx1.pdf" redirectType="Permanent" />
</rule>
【解决方案2】:
我找到了解决方案。我已经从浏览器中检查了响应头的最大年龄(Max-age)。 cloudflare 缓存设置为 2592000(720 小时)的最大使用期限。这就是为什么它没有反映这些变化。所以我们要求cloudflare团队清除缓存问题已经解决了