Saturday, November 13, 2010

client denied by server configuration: .htaccess

I was getting the error "client denied by server configuration: /.htaccess" in one specific location recently and I wasn't sure what was going on. Permissions allowed the .htaccess file to be read, because the directives set in that .htaccess were taking effect. There was also no special reason for anyone to try and navigate directly to this directories .htaccess file.

It turns out, that the problem had to do with mod_autoindex. The directory in question is setup to use mod_autoindex and list a bunch of changelogs in the directory. For whatever reason, mod_autoindex wants to access .htaccess while it's building a list of files and since .htaccess files are disallowed for all in the normal Apache configuration, it's getting that permission error.

I've found that adding .htaccess to the IndexIgnore directive will stop this error from happening. Since I also have mod_autoindex ignore the link to a parent directory, my IndexIgnore directive looks like this.

IndexIgnore .. .htaccess

3 comments:

Andrey said...

I have the same error. But even disabling mod_autoindex does not solve the problem. Still searching for the decision.

Andrey said...

Hm, moved all files including .htaccess to "trunk" and the error disappeared. I suppose there're some inner hardcoded rules for HTTP SVN .htaccess at root folder.

Gnarlodious said...

THANK YOU! This solved my problem.