小编nte*_*arc的帖子

有没有办法用tomcat实现X-Robots-Tag指令?

我想添加X-Robots-Tag noindex, nofollow到网站的所有 .PDF 文件的 HTTP 响应中,以避免这些文档被 Google 搜索引擎引用。

这是适用于 Heroku 上带有 Spring boot 2.1 的 Tomcat 8 服务器。过去,我尝试过 Apache Server,并且noindex运行nofollow良好。

<Files ~ "\.pdf$">
  Header set X-Robots-Tag "noindex, nofollow"
</Files>
Run Code Online (Sandbox Code Playgroud)

java tomcat heroku spring-boot x-robots-tag

2
推荐指数
1
解决办法
1273
查看次数

标签 统计

heroku ×1

java ×1

spring-boot ×1

tomcat ×1

x-robots-tag ×1