Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我们希望防止 pdf 文件在我们的 sulu 1.6 网站中被索引。显然,如果 pdf 文件也X-Robots-Tag: noindex附有附件,则此方法效果最好。
X-Robots-Tag: noindex
有没有办法在 sulu 中配置或轻松添加额外的 http 标头?
多谢!
我们发现,在架构方面(关注点分离)最好在网络服务器级别解决这个问题。
在我们的球童中:
header *.pdf { X-Robots-Tag "noindex, nofollow" }
我也喜欢最好不要为此劫持 sulu/symfony。
2020 年 2 月更新 实际上事实证明,我们的网络服务器球童并不像上述假设那样直截了当。Caddy 2 可能可以做到,但不是喷气式飞机。
我们还将进行一些调查,因为我们可以将 pdf 文件上传到特定文件夹而不是动态交付 atm。