Phil Birnie
Phil Birnie

Reputation: 1134

Unable to hide htaccess file

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.

Upvotes: 1

Views: 894

Answers (1)

Perleone
Perleone

Reputation: 4038

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.

Upvotes: 2

Related Questions