0

i need all links to PDFs document in my website must be "noindex, follo", i write in my htacccess:

<Files ~ "\.pdf$">
Header set X-Robots-Tag "noindex, follow"
</Files>

But this is don't work. When i use SEO's tools say that all the links to PDFs are "index, follow".

Can you help me?

Thanks.

EDC
  • 1
  • 1

2 Answers2

0

Add to your robots.txt in the APP main folder:

Disallow: /*.pdf

If you are using apache you can aswell do:

<Files ~ "\.pdf$">
  Header set X-Robots-Tag "noindex, nofollow"
</Files>

Last option is to add to each '< a >' containing a PDF:

rel="noindex"

Cheers.

DanielPanic
  • 184
  • 1
  • 11
  • Disallow: /*.pdf is no correct because i want to the PDF document be follow (noindex, follow) the other two things that you say i do but don't work. – EDC Jun 28 '18 at 10:54
0

Exact - the rule you cited is to make pdf files noindexed, and to make all links inside pdf files nofollowed.

To do so, what you mean, you should invent any heuristic to find in your source code links to pdf files and add to them rel="nofollow".

It could be something like a search and replace procedur on the whole codebase - something like: search for pattern .pdf"> and replace with .pdf" rel="nofollow">.

For some CMS, like Wordpress or Joomla there are plugins/extensions able to do the like directly on the codebase and database.

Evgeniy
  • 2,337
  • 2
  • 28
  • 68