0

.htaccess に次のものがあります。

# "-Indexes" will have Apache block users from browsing folders without a
# default document Usually you should leave this activated, because you
# shouldn't allow everybody to surf through every folder on your server (which
# includes rather private places like CMS system folders).
<IfModule mod_autoindex.c>
  Options -Indexes
</IfModule>

ただし、アクセスを有効にする必要があるインデックス ファイルを持たないディレクトリがあります (この方法で保存することを好みます)。上記のコードからこのディレクトリを除外するにはどうすればよいですか?

4

2 に答える 2

1

そのディレクトリに .htaccess ファイルを作成し、その中に以下を入れます。

<IfModule mod_autoindex.c>
  Options +Indexes
</IfModule>
于 2016-01-18T18:54:09.747 に答える