: X-Robots noindex a folder of PDFs I'd like to noindex a group of PDFs within a certain folder. There are other PDFs on site that I do want indexed, so I want to avoid using <FilesMatch
I'd like to noindex a group of PDFs within a certain folder. There are other PDFs on site that I do want indexed, so I want to avoid using
<FilesMatch ".pdf$">
Header set X-Robots-Tag "noindex, nofollow"
</FilesMatch>
The folder will be named "pdf-ns". Is there a way to only noindex only this group?
More posts by @Shelley277
1 Comments
Sorted by latest first Latest Oldest Best
Yes, just place that rule inside of its own .htaccess file within the directory containing those PDFs. It will only affect them (and any in subdirectories of that directory). That rule does not have to be in your main root web directory. You are allowed to place .htaccess files in subdirectories as well.
If you have a mix of PDFs in a directory, some of which you want blocked and some of which you do not, you would either need to separate them into their own directory and use the rule above, or redefine your rule to list the PDFs you do want blocked.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.