gpt4 book ai didi

apache - .htaccess 文件未被读取 .htaccess 文件中的 ("Options -Indexes"不起作用)

转载 作者:行者123 更新时间:2023-12-02 10:53:00 24 4
gpt4 key购买 nike

我创建了一个仅包含以下行的 .htaccess 文件:

Options -Indexes



但是,仍会显示目录的索引。

我刚刚安装了 Apache2 并使用了所有默认值(我没有修改 apache2.conf 或 httpd.conf)。

操作系统: Ubuntu 12.04 (Precise Pangolin)Apache2 版本: Server version: Apache/2.2.22 (Ubuntu) Server built: Feb 13 2012 01:51:56

$ ls -l .htaccess
-rwxr-xr-x .htaccess



编辑:

我接受了 lanzz 的建议,并在 .htaccess 中添加了一些胡言乱语。文件,并发现 .htaccess文件没有被读取。

最佳答案

您应该检查 Apache 配置是否允许执行 .htaccess。在您的虚拟主机配置中,应该有一行:
AllowOverride All
如果没有,这就是 .htaccess 没有生效的原因。

关于apache - .htaccess 文件未被读取 .htaccess 文件中的 ("Options -Indexes"不起作用),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10769880/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com