最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Apache设置禁止访问网站目录(目录列表显示文件)
时间:2022-06-25 00:13:45 编辑:袖梨 来源:一聚教程网
进入apache的配置文件 httpd.conf 找到:
| 代码如下 | 复制代码 |
|
Options Indexes FollowSymLinks 修改为: Options FollowSymLinks |
|
其实就是将Indexes去掉,Indexes表示若当前目录没有index.html就会显示目录结构。
| 代码如下 | 复制代码 |
|
1. 禁止访问某些文件/目录
禁止访问某些指定的目录:(可以用
通过文件匹配来进行禁止,比如禁止所有针对图片的访问:
针对URL相对路径的禁止访问: |
|
配置示例:
| 代码如下 | 复制代码 |
|
# # 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.ap*ach**e.org/docs/2.2/mod/core.html#options # for more information. # 就是这一行,只去掉indexes也可 #Options Indexes FollowSymLinks Options FollowSymLinks # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride None # # Controls who can get stuff from this server. # Order allow,deny Allow from all 建议默认情况下,设置APACHE禁止用户浏览目录内容。 |
|
相关文章
- 塞尔达无双封印战记刷钱点位推荐 塞尔达无双封印战记在哪刷钱 12-08
- 塞尔达无双封印战记全材料效果一览 塞尔达无双封印战记材料海鲜篇 12-08
- 超自然行动组蛤蟆怎么打 怪物蛤蟆捕捉方法 12-08
- 逃离鸭科夫uphone手机怎么获得 uphone手机获取方法详情 12-08
- 塞尔达无双封印战记全材料效果一览 塞尔达无双封印战记全材料动物篇 12-08
- 超自然行动组大熊怎么打 怪物大熊捕捉方法 12-08