3

When I add an empty .htaccess file to server root (touch .htaccess) I get a 403 error. The samme error appears no matter what I put in the file (I've tried specifying <LIMIT> directives etc).

Example of auth directive I've tried:

<Limit GET POST>
  Order deny,allow
  AuthType Basic
  AuthUserFile /path/to/file
  AuthName "Tits for Haiti etc"
  Require valid-user
</Limit>

Whats the deal?

o01
  • 249
  • 2
  • 12

1 Answers1

6

If the webserver cannot read the file you will get this problem. Make sure that the webserver can read the file by setting the ownership and permissions on the .htaccess appropriately.

user9517
  • 115,471
  • 20
  • 215
  • 297
  • Ok, thanks. What is the appropriate permission setting? 700? 755? – o01 Apr 19 '11 at 15:04
  • 1
    It depends on what the ownership of the file is. If you can, set the ownership to the user that the webserver runs as then 400 would be sufficient once it's configured how you want it. Other wise 644 should do it. – user9517 Apr 19 '11 at 15:07
  • Excellent:D It totally worked with 644. Thanks again! – o01 Apr 19 '11 at 15:13