Any help on where I am going wrong
CodePudding user response:
<Files "\.pdf$"> Header set X-Robots-Tag "noindex, nofollow" </Files>
You have copied the linked solution incorrectly. To match a regex with the Files
directive you need the additional ~
argument. ie. <Files ~ "\.pdf$">
. (Although the FilesMatch
directive is arguably preferable when using a regex.)
However, you do not need a regex here. Just use the standard Files
directive with a wildcard (not regex) pattern. For example:
<Files "*.pdf">
:
Reference: