
內容簡介
這個外掛能快速輸出 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 時,會略過處理請求的過程。
外掛標籤
開發者團隊
原文外掛簡介
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.
