I have folder with Indexes option. I have hide all files in listing directory except (jpe?g|pdf|bmp|png|html|css).
我有带索引选项的文件夹。我隐藏了列表目录中的所有文件,除了(jpe?g | pdf | bmp | png | html | css)。
But my config do not working). Help me,please fix it.
但我的配置不起作用)。帮帮我,请修理一下。
<Directory /home/*/Downloads>
AllowOverride All
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<FilesMatch "\.(htaccess|jpe?g|pdf|bmp|png|html|css)$">
Order allow,deny
allow from all
</FilesMatch>
<FilesMatch "">
Order deny,allow
deny from all
</Filesmatch>
</Directory>
p.s. Apache 2.2
附: Apache 2.2
1 个解决方案
#1
Change the order of your FilesMatch
directives, i.e. block everything first then allow certain type of files later:
更改FilesMatch指令的顺序,即先阻止所有内容,然后再允许某些类型的文件:
<FilesMatch "">
Order deny,allow
deny from all
</Filesmatch>
<FilesMatch "\.(htaccess|jpe?g|pdf|bmp|png|html|css)$">
Order allow,deny
allow from all
</FilesMatch>
#1
Change the order of your FilesMatch
directives, i.e. block everything first then allow certain type of files later:
更改FilesMatch指令的顺序,即先阻止所有内容,然后再允许某些类型的文件:
<FilesMatch "">
Order deny,allow
deny from all
</Filesmatch>
<FilesMatch "\.(htaccess|jpe?g|pdf|bmp|png|html|css)$">
Order allow,deny
allow from all
</FilesMatch>