I want to add X-Robots-Tag noindex, nofollow
to the HTTP response of all the .PDF files of a site to avoid that these documents be referenced by the Google search engine.
This is for Tomcat 8 server on Heroku with Spring boot 2.1. From the past, I've tried on Apache Server and the noindex
and nofollow
worked well.
<Files ~ "\.pdf$">
Header set X-Robots-Tag "noindex, nofollow"
</Files>