Title: Fast 404
Author: Ayesh Karunaratne
Published: <strong>2020 年 5 月 18 日</strong>
Last modified: 2023 年 7 月 23 日

---

搜尋外掛

![](https://ps.w.org/fast404/assets/banner-772x250.png?rev=2307352)

這個外掛**並未在最新的 3 個 WordPress 主要版本上進行測試**。開發者可能不再對這個
外掛進行維護或提供技術支援，並可能會與更新版本的 WordPress 產生使用上的相容性問題。

![](https://ps.w.org/fast404/assets/icon-256x256.png?rev=2307352)

# Fast 404

 由 [Ayesh Karunaratne](https://profiles.wordpress.org/ayeshrajans/) 開發

[下載](https://downloads.wordpress.org/plugin/fast404.1.2.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/fast404/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/fast404/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/fast404/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/fast404/#developers)

 [技術支援](https://wordpress.org/support/plugin/fast404/)

## 外掛說明

Fast 404 is a low foot-print plugin that quickly inspects an incoming HTTP request,
and terminates the request as soon as possible if the request is for a non-existing
resource. If the browser is expecting an HTML page (indicated by the `Accept` HTTP
header), this plugin will not intercept it. For all other requests, this plugin 
will terminate it immediately, saving server resources and bandwidth.

When a user browser requests a resource (such as a `jpg` image, or a `.woff2` font
file), the web server sends this resource if it is available in the requested location.
If the file does not exist, the request is forwarded to WordPress to handle. Unless
you are using a plugin that dynamically generates these files, these file-not-found
requests trigger a full WordPress Page-Not-Found error page. This plugin inspects
such incoming requests, and if the browser indicates that it is looking for a resource
other than an HTML page, this plugin terminates the request as soon as possible 
to prevent WordPress from serving this request which would be a waste of resources
and bandwidth. This plugin carefully makes sure that the short-circuited 404 pages(
which just shows “Not Found” on a blank page) is only returned to browser asset 
requests, and not for end users who expect an HTML page.

By default, all HTTP requests to `js|css|jpg|jpeg|gif|png|webp|ico|exe|bin|dmg|woff
|woff2` extensions will be fast 404’d. You can configure the extensions and even
configure an exclusion pattern to prevent this plugin from intercepting certain 
requests.

This plugin is the WordPress port of [PHPWatch/Fast404](https://github.com/PHPWatch/Fast404)
package.

## 安裝方式

 1. Upload the plugin files to the `/wp-content/plugins/` directory, or install the
    plugin through the WordPress plugins screen directly.
 2. Activate the plugin through the ‘Plugins’ screen in WordPress.
 3. You are all set!

## 常見問題集

### How to configure the error message?

This plugin ensures that the error message is not shown to end users who request
URLs from the browser address bar. It is configured as “Not Found” by default.

However, you can override this message by adding a PHP constant to your `wp-config.
php` file. Anywhere in this file, put this:

    ```
    define('FAST404_ERROR_MESSAGE', 'My new error message');
    ```

### How to configure file types?

By default, `js|css|jpg|jpeg|gif|png|webp|ico|exe|bin|dmg|woff|woff2` extensions
are terminated early.

You need to define a PHP constant in `wp-config.php` file to override this. The 
value of the constant MUST be a valid regular expression matched against the request
URI.

    ```
    define('FAST404_REGEX', '/\.(?:js|css|jpg|jpeg|gif|png|webp|ico|exe|bin|dmg|woff|woff2)$/i')
    ```

### How can I log requests?

You cannot. The whole point of this plugin is to save server resources when the 
request cannot be served. It takes the first opportunity to terminate the request,
and it might be early in the page request-cycle that any of the logging functionality
is even available yet.

### What screams “I’m insecure”?

“http://”

## 使用者評論

這個外掛目前沒有任何使用者評論。

## 參與者及開發者

以下人員參與了開源軟體〈Fast 404〉的開發相關工作。

參與者

 *   [ Ayesh Karunaratne ](https://profiles.wordpress.org/ayeshrajans/)

[將〈Fast 404〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/fast404)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/fast404/)、查看
[SVN 存放庫](https://plugins.svn.wordpress.org/fast404/)，或透過 [RSS](https://plugins.trac.wordpress.org/log/fast404/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/fast404/)。

## 變更記錄

#### 1.0

 * Initial release.

#### 1.0.1

 * Updates the WordPress core version this plugin was tested against.
 * Minor text improvements.

#### 1.2

 * Same version as 1.0.1, but with a consistent version number bump.

## 中繼資料

 *  版本 **1.2**
 *  最後更新 **3 年前**
 *  啟用安裝數 **50+**
 *  WordPress 版本需求 ** 3.9.2 或更新版本 **
 *  已測試相容的 WordPress 版本 **6.3.8**
 *  PHP 版本需求 ** 7.1 或更新版本 **
 *  語言
 * [English (US)](https://wordpress.org/plugins/fast404/)
 * 標籤:
 * [404](https://tw.wordpress.org/plugins/tags/404/)[page not found](https://tw.wordpress.org/plugins/tags/page-not-found/)
   [performance](https://tw.wordpress.org/plugins/tags/performance/)
 *  [進階檢視](https://tw.wordpress.org/plugins/fast404/advanced/)

## 評分

這個項目尚無任何評論記錄。

[Your review](https://wordpress.org/support/plugin/fast404/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/fast404/reviews/)

## 參與者

 *   [ Ayesh Karunaratne ](https://profiles.wordpress.org/ayeshrajans/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/fast404/)