[WordPress] 外掛分享: Disable Directory Listings

首頁外掛目錄 › Disable Directory Listings
100+
安裝啟用
★★★★★
5/5 分(1 則評價)
5345 天前
最後更新
問題解決
WordPress 3.0+ v2.0 上架:2011-07-28

內容簡介

此外掛可防止虛擬目錄列出目錄內容,或在虛擬目錄列出時顯示自定義頁面。

如果網站的某個目錄中沒有索引檔案(例如 index.html 或 index.php),則 Apache 網頁伺服器可自動顯示該目錄的內容列表。這可能會將檔案和資訊公開給訪客。當然,網頁伺服器可以設定為不這樣做(建議做法),但有時候您可能無權限(因為您在共享主機上)、無專業技術知識,或者您想有選擇性地禁止虛擬目錄列表。這種情況下,此外掛就能提供幫助。

如果您要測試您的網站是否啟用了虛擬目錄列表,請嘗試訪問 http://www.YOURSITE.com/wp-includes(顯然,請將域名改為您自己的)。如果您看到 PHP 文件列表,那麼您的網站就啟用了虛擬目錄列表。

如果您的網頁伺服器生成虛擬目錄列表,此外掛可以防止訪客查看特定目錄(或所有目錄)的內容。此外,它還允許您將 WordPress 頁面用作目錄索引。

默認情況下,以下目錄受到保護:

wp-includes/
wp-content/
wp-content/plugins/
wp-content/themes/

它不會默認保護任何其他目錄。您可以通過外掛的管理設置頁面進行更改。

提示:當此外掛被啟用(更具體地說是在遵循下面的說明更新永久連結結構之後),WordPress 將生成主題 404 - 找不到頁面。如果您要創建具有與禁用的目錄之一(例如 'wp-includes' 或 'wp-content')相同名字的頁面,則該頁面將顯示,而不是顯示404錯誤訊息。如果您想顯示“外掛”和“主題”目錄的頁面,則必須將它們創建為“wp-content”頁面的子頁面。

注意:此外掛只適用於 Apache 網頁伺服器。

連結: 插件主頁 | 作者主頁

外掛標籤

開發者團隊

⬇ 下載最新版 (v2.0) 或搜尋安裝

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

原文外掛簡介

Prevent virtual directory listing services from listing the contents of directories, and/or show a page in place of a directory’s listing.
The Apache web server can be configured to automatically display the listings of the contents of a web site’s file directory if no index file (i.e. index.html or index.php) is present. This can expose files and information to visitors. Of course the web server could be configured to not do this (the recommended approach), but sometimes you don’t have permission (you’re on a shared host), the know-how, or you want to selectively disallow virtual directory listings. That’s where this plugin can help.
If you want to test if your site has virtual directory listings enabled, try visiting http://www.YOURSITE.com/wp-includes (obviously, change the domain to match your own). If you see a listing of PHP files then virtual directory listing is enabled for your site.
This plugin can prevent visitors from seeing the contents of certain (or all) directories on your site (assuming your web server generates virtual directory listings). It also allows you to use a WordPress page as the index for a directory
By default, the following directories are protected:

wp-includes/
wp-content/
wp-content/plugins/
wp-content/themes/

It does NOT protect any other directory by default. You can change this via the plugin’s admin settings page.
TIP: When this plugin is activated (and more specifically, ater the permalink structure is updated as per the instructions below), WordPress will generate the themed 404 – Not Found page. If you were to create a Page with the same name as one of the directories being disabled (i.e. ‘wp-includes’ or ‘wp-content’) then that page will be displayed instead of the 404 error message. If you want to display a page for the ‘plugins’ and ‘themes’ directory, you must create them as children pages of a ‘wp-content’ page.
NOTE: This plugin only works for the Apache web server.
Links: Plugin Homepage | Author Homepage

延伸相關外掛

文章
Filter
Apply Filters
Mastodon