Mobile app version of vmapp.org
Login or Join
Shelley277

: 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

@Shelley277

Posted in: #Indexing

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?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Shelley277

1 Comments

Sorted by latest first Latest Oldest Best

 

@Sarah324

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme