无法隐藏htaccess文件 [英] Unable to hide htaccess file
问题描述
我很难隐藏我的.htaccess文件-我仔细检查以确保httpd.conf中存在以下内容:
I'm having a difficult time hiding my .htaccess file -- I double-checked to ensure the following was present in httpd.conf:
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
目录上的其他allow/deny指令正在运行,可见的.htaccess文件中的指令正在运行.
Other allow/deny directives on directories are working and the directives in the visible .htaccess file are working.
我们正在运行Red Hat Enterprise Linux Server 6.3(圣地亚哥)和Apache/2.2.15.
We are running Red Hat Enterprise Linux Server release 6.3 (Santiago) and Apache/2.2.15.
我的问题:除了显而易见的原因:为什么.htaccess文件仍然可见?"是否有其他一些指令可以覆盖该指令,或者我可能缺少模块? (我认为如果是这种情况,apache会抛出一个错误.)
My question: Aside from the obvious of, "Why is the .htaccess file still visible?" Is there some other directive that would override this directive or might I have a module missing? (I would think apache would throw an error if this were the case.)
对该文件进行任何更改后,我重新启动了apache,甚至还进行了完整性检查以重新启动.我还对该文件进行了其他一些更改,以确保我使用的是正确的配置文件.
I restarted apache after any changes to this file and even rebooted as a sanity check. I also made some other changes to this file to ensure that I was working on the correct configuration file.
推荐答案
Have you taken a look at How <Directory>, <Location> and <Files> sections work
? It seems that there might be another directive (probably Location
) evaluated later, which overrides your Files
directive. It's hard to diagnose more without further details of your Apache configuration.
这篇关于无法隐藏htaccess文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!