|  |      1learnshare      2015-12-18 10:27:55 +08:00  1 | 
|  |      2neodreamer OP 这里没 VPN 我用 Bing 搜索下你给的关键词,之间搜索过 apache conf 关键词,没发现有用的。 | 
|  |      3yylzcom      2015-12-18 10:30:54 +08:00  1 "禁用 index 可以不罗列目录,但是 目录下的文件也不能访问了" 这句话不成立,禁用 index 恰好就是实现你的需求,不列出目录且能直接访问文件 | 
|  |      4yylzcom      2015-12-18 10:32:27 +08:00  1 如果还不行,你就设置 apache ,随便弄一个空白 index.html, index.shtml 的文件进去,访问目录的时候就访问这个文件,而不会列出目录下的文件了。 | 
|  |      5neodreamer OP <Directory "E:/Server"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.4/mod/core.html#options # for more information. # Options FollowSymLinks # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # AllowOverride FileInfo AuthConfig Limit # AllowOverride All # # Controls who can get stuff from this server. # Require all granted </Directory> 现在的系统设置, Options FollowSymLinks (原先是 Options Indexes FollowSymLinks )这种设置也导致目录下的内容访问不了如 http://projectstrike.test/attachment/1447832084.pdf (用的 Cakephp 框架) | 
|  |      6neodreamer OP @yylzcom  难道是跟框架.htaccess 设置有关系? <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ webroot/ [L] RewriteRule (.*) webroot/$1 [L] </IfModule> | 
|  |      7neodreamer OP @learnshare 感谢已发送。 | 
|  |      8Tink PRO  1 你把目录浏览禁用了,然后本来就能通过文件访问 | 
|  |      9neodreamer OP @Tink 我的设想是访问目录时禁止罗列目录下的所有文件,但是如果知道目录下的具体文件名称时,可以直接通过链接直接访问。 | 
|  |      10strahe      2015-12-18 10:42:43 +08:00  1 本身就支持的又不是什么特别的需求 | 
|  |      11neodreamer OP @strahe 囧,发现了,自己犯了个严重错误,实际上  把 Options Indexes FollowSymLinks 改成 Options FollowSymLinks 就可以了。感谢楼上各位鼎力相助。 | 
|  |      12neodreamer OP 麻烦管理员把这个帖子移到 水节点下。 的确太水了。 |