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

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

Whats the deal?

share|improve this question
whats the access rights on the file? – Trozz Apr 19 '11 at 14:54
@Trozz 600, -rw------- – o01 Apr 19 '11 at 15:01
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
up vote 6 down vote accepted

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.

share|improve this answer
Ok, thanks. What is the appropriate permission setting? 700? 755? – o01 Apr 19 '11 at 15:04
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. – Iain 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 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.