Prevent Directory Listing防ぐためのディレクトリリスティング
January 31st, 2007 · by David Bradley 2007年1月31日にデビッドブラッドリー
If you followed my advice to move from Blogspot to your own domain hosted Wordpress blog, then you may have noticed (depending on how your new host server is set up) that opening certain directories produces not the page you were expecting, but a listing of the contents of that directory.その後に移動する場合に私からのアドバイスを自分のドメインのホストからのBlogSpotのWordPress Blog 、入力して気づいたことがあります(あなたの新しい方法に応じてホストサーバーをセットアップ)が開会の特定のディレクトリに生成された特定のページを期待し、リスティングのではなく、の内容をそのディレクトリに移動します。
Now, that’s not usually a problem for most users, it just generates an ugly directory that makes your site look unprofessional.今すぐ、それは問題は、通常、ほとんどのユーザにとっては、それだけを生成することにより、お客様のサイト醜いディレクトリプロらしくない見ています。 However, it can expose file and folder names on your server that you don’t want visitors to browse and read.ただし、ファイル名やフォルダ名にさらすことができますして、サーバーのことを望まない場合は訪問者を参照すると読む。
There is a very quick fix for this.非常に高速には、この修正プログラムです。
Open your .htaccess file (usually in the root folder or public_html)を開いて。 htaccessファイル(通常のルートフォルダにまたは、 public_htmlと)
near the top simply enter the following line of code and save the file.の上部に、単に次のコード行を入力して、ファイルを保存します。
IndexIgnore * indexignore *
Now, when you try to open that “directory listing” it won’t display the folder’s contents.今すぐ、しようとしたときを開くには"ディレクトリリスティング"これが正しく表示されたフォルダの内容です。
If you don’t want to block all browsing, just gifs and jpgs or zip files for instance, then use the following syntax instead:したくない場合は、すべてのブラウジングをブロックする、またはzipファイルだけGIFファイルとjpgsたとえば、次の構文を使用して入力し、代わりに:
IndexIgnore *.gif *.jpg indexignore *. gif *. jpg
IndexIgnore *.zip indexignore *.郵便番号
IndexIgnore *.mp3 indexignore *. mp3
(You get the picture) (画像を入手して)
Conversely, you might actually want to allow browsing of directories, but it’s disabled on your host by default.逆に、あなたかもしれないようにするには、実際のディレクトリブラウジングが、それはあなたのホスト、デフォルトで無効になっています。 Again, it’sa .htaccess issue, see if IndexIgnore is already in there and delete it, if not enter this line instead:繰り返しますが、これは。 htaccessの問題では、 indexignoreがいるかどうか、および削除が既に用意されて、この行の代わりに入力していない場合は:
Options +Indexesオプション+インデックス
That opens up directory listing for the root folder (and/or any other folders in which you have a .htaccess file).口を開くディレクトリのリストをのルートフォルダに(および/またはその他のフォルダではあなたには、 。 htaccessファイル) 。
However, even that is not a particularly elegant solution.しかし、特にエレガントな解決策されていない。 What I was finding till I did the following tweak was that Wordpress was displaying the contents of the feed folder rather than displaying the feed.私は何を見つけるまで私は、次の微調整は、 WordPressのは、フィードのフォルダの内容を表示してではなく、フィードを表示しています。 So, here’s the solution that makes a click on that directory do the right thing.そこで、ここでの解決策には、をクリックして、そのディレクトリには、正しいことです。 Open CPanel and navigate to your Index Manager. cpanelとオープンして、インデックスに移動してマネージャを起動します。 Click the feed folder (or whichever folder you want to block directory listing of) and choose “No Indexes”.フィードをクリックしてフォルダ(またはいずれかのディレクトリリスティングをブロックするフォルダを選択)を選択し"インデックス"です。 That got my rss feed for this site working properly, and if applied to other folders too prevents directory listings and spawns a 403 error page, which can be customized.私がこのサイトのRSSフィードが正常に動作し、他のフォルダの場合に適用さあまりにも防ぎますディレクトリリスティングや403エラーページを生成することができるようカスタマイズします。 More on custom 404 and 403 pages another timeカスタム404と403ページの詳細については別の時間






















0 responses so far ↓ 0レスポンスこれまでのところ↓
Got something to say?伝えたいことを言うですか? Start a comment thread here.ここのコメントのスレッドを開始する。 Top commentators get a FREE link on the homepage!トップへコメンテーターのホームページにリンクを取得する無料!
Leave a Commentコメントを残す