內容簡介
Hotlink File Prevention (HFP) 提供簡易的防盜鏈保護,可以在 WordPress 媒體庫中針對個別檔案開啟或關閉。
「盜鏈」是指從其他網站引用或手動輸入網址列以顯示檔案,例如圖片或 PDF。HFP 只允許在您的網站上顯示檔案。
防盜鏈保護是透過在 wp-content/uploads 資料夾中的 .htaccess 規則提供。
基本用法
啟用 HFP 外掛後,您將在媒體庫中看到兩個新功能:
在「螢幕選項」選單中(僅限清單檢視),可以勾選「防盜鏈」欄位的核取方塊。
若要保護檔案,請編輯檔案並向下捲動到標有「防盜鏈保護」核取方塊的位置。
勾選的任何資源都會在「防盜鏈」欄位中顯示「是」,否則此欄位將為空白。
關於「在新分頁中開啟」選項的注意事項
當您使用連結的「在新分頁中開啟」選項時,WordPress 會添加 rel="noreferrer",這會讓連結像直接訪問一樣,未啟用 HFP 保護的檔案連結也會被封鎖。
外掛標籤
開發者團隊
原文外掛簡介
Hotlink File Prevention (HFP) offers simple hotlink protection that can be turned on/off for individual files in the WordPress media library.
“Hotlinking” is when a file, such as an image or PDF, is linked to from another website or entered manually in a web browser’s location bar. HFP only allows your file to be viewed on your website.
Hotlink protection is provided via .htaccess rules in the wp-content/uploads directory.
Basic Usage
Once the HFP plugin is activated, you will have two new features in the media library:
Within the Screen Options tab (list view only), check box for the “Hotlink Prevention” column.
To protect a file, edit the file and scroll down to the checkbox labelled “Hotlink Protection”.
Any asset that is checked will have “Yes” displayed in the “Hotlink Prevention” column; otherwise, this column will be blank.
Note about “Open in new tab” option
When you use the “Open in new tab” option for links, WordPress adds rel="noreferrer", which effectively makes the link act like direct access, and the link will be blocked for files protected using HFP.
