[WordPress] 外掛分享: Static 404

首頁外掛目錄 › Static 404
WordPress 外掛 Static 404 的封面圖片
3,000+
安裝啟用
尚無評分
1670 天前
最後更新
問題解決
WordPress 5.2+ PHP 5.6+ v1.1.0 上架:2021-05-27

內容簡介

這個外掛能快速輸出 404 錯誤給找不到的靜態檔案,而非載入一般的 404 頁面。

任何不存在的靜態檔案(圖片、文字、PDF 等)將會立即顯示 404 錯誤,而非載入整個 WordPress 程式。

詳情

預設會檢查的副檔名列表是由 wp_get_ext_types 的結果,但可以透過過濾器 static_404_extensions 修改。

輸出的是一個包含文字「404 Not Found」的靜態頁面,可以透過過濾器 static_404_message 修改這個文字。

會使用 404 狀態碼,但可以透過過濾器 static_404_response_code 修改狀態碼。

在 static_404_should_process_request 過濾器傳入目前的請求,當這個過濾器回傳 true 時,會略過處理請求的過程。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.1.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Static 404」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Quickly output a 404 for static files that aren’t found, rather than loading the normal 404 page.
Any static files ( images, text, pdfs, etc ) that don’t exist will 404 as soon as possible, rather than loading the entire WordPress application.
Details
By default, the list of extensions to check are the results of wp_get_ext_types, but can be filtered with static_404_extensions.
The output is a static page with the text 404 Not Found, this text can be edited by filtering static_404_message.
A 404 status code will be used, but can be filtered with static_404_response_code.
Passing true to static_404_should_process_request will short-circuit and skip processing the request. This filter gets passed the current request.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon