I have built a client/user front-end login.
This works fine, on the page I want to add some links to PDF files.
These PDF files needs to be protected. Google should not index them!
I think google will index them, so I searched the web.
I found 3 ways to protect the PDF files from indexing by google/others.
1) .htaccess
<FilesMatch "\.pdf$">
header set x-robots-tag: noindex
</FilesMatch>
2) Use robots.txt to block the files from search engines crawlers
User-agent: *
Disallow: /assets/files/ # Block the directory.
Disallow: *.pdf # Block pdf files. Non-standard but works for major search engines.
3) Use rel="nofollow" on links to those PDFs
<a href="file.pdf" rel="nofollow">Download PDF</a>
Is 3) possible with TinyMCE, I don't see the rel on advanced? Or maybe add it with javascript, if so, how?
The script needs to change every <a href into <a rel="nofollow" href (in a div with class="protected") and does that actually work?
Oops, this post is placed in Development, if anyone can move it to general?
[ed. note: fourroses666 last edited this post 11 years ago.]