Unable to hide htaccess file

核能气质少年 提交于 2019-12-31 04:27:08

问题


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>

Other allow/deny directives on directories are working and the directives in the visible .htaccess file are working.

We are running Red Hat Enterprise Linux Server release 6.3 (Santiago) and Apache/2.2.15.

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.)

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.


回答1:


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.



来源:https://stackoverflow.com/questions/13598053/unable-to-hide-htaccess-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!