我的示例 PDF 網址是:

關于我哪里出錯的任何幫助
uj5u.com熱心網友回復:
<Files "\.pdf$"> Header set X-Robots-Tag "noindex, nofollow" </Files>
您錯誤地復制了鏈接的解決方案。要將正則運算式與Files指令匹配,您需要附加~引數。IE。<Files ~ "\.pdf$">. (盡管FilesMatch在使用正則運算式時該指令可以說是更可取的。)
但是,您在這里不需要正則運算式。只需將標準Files指令與通配符(不是正則運算式)模式一起使用。例如:
<Files "*.pdf">
:
參考:
- https://httpd.apache.org/docs/current/mod/core.html#files
- https://httpd.apache.org/docs/current/mod/core.html#filesmatch
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/510603.html
