Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been setting up ErrorDocuments for a website I'm working, and generally they've been working. However, after I set the 403 ErrorDocument, I noticed that it didn't work when I tried to access the .htaccess file itself. When I access a different forbidden file, the Error Document appears just fine. How can I make the ErrorDocument work on the .htaccess file?

If you didn't follow my explanation, here are links to show you what I mean:
ErrorDocument works fine:
ErrorDocument doesn't work:

share|improve this question

migrated from Nov 12 '11 at 0:08

This question came from our site for professional and enthusiast programmers.

The .htaccess file is most likely uploaded with your user permissions, allowing it to be viewed like any other file you might upload. The . at the front only makes the file hidden from the standard file list, so that people don't see it listed. It does not completely forbid access to the file.

Check the file's permissions and try to make them match whatever the permissions for the .ftpquota file are.

share|improve this answer
Okay, I tried setting .htaccess down to 600 (it had been at 755) and that just made both pages break (the .ftpquota page said it got a 403 error trying to retrieve the ErrorDocument from .htaccess). I think something else besides Apache is forbidding the .htaccess file, but I don't know what. The 403 error page appearing for the .htaccess says nginx; what is that? (lol im new to apache, clearly) – oxguy3 Nov 11 '11 at 19:57

I suspect the issue is that your error document definition is in the file which is being accessed. Have you tried placing the ErrorDocument definition in an htaccess in the parent directory?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.