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?

4
  • 1
    whats the access rights on the file?
    – trozz
    Apr 19 '11 at 14:54
  • @Trozz 600, -rw-------
    – o01
    Apr 19 '11 at 15:01
  • 1
    that is the problem :) give read rights to the webserver :)
    – trozz
    Apr 19 '11 at 15:04
  • Thanks @Trozz. Still unsure what permission setting I should set. Id mark your suggestion as the answer if you'd create one :)
    – o01
    Apr 19 '11 at 15:06
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.

3
  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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