0

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: http://keycraft.haydencity.net/.ftpquota
ErrorDocument doesn't work: http://keycraft.haydencity.net/.htaccess

2 Answers2

0

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.

animuson
  • 279
  • 1
  • 6
  • 20
  • 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) –  Nov 11 '11 at 19:57
0

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?

cwallenpoole
  • 325
  • 2
  • 13