I'm running a server:

Apache/2.2.8 (Ubuntu) mod_ssl/2.2.8 OpenSSL/0.9.8g

Without a .htaccess file, everyone can access the web content. However, I add a .htaccess file with the following content:

Allow from all

... and everyone gets 403 Forbidden errors on every page! The permissions on .htaccess are 640. Shouldn't Allow from all be the same as having no .htaccess file? What have I done wrong?

edit: same behaviour with the following .htaccess file:

Order Allow,Deny
Allow from all

Again, with no .htaccess file everything loads without a problem.

migrated from stackoverflow.com Jun 17 '11 at 19:25

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

  • I have to wonder why you would add an .htaccess file that is intended to give the same results as not having one. Something you're not telling us? – John Gardeniers Jun 17 '11 at 23:25
Order Allow,Deny
Allow from all
  • Okay, tried that. Same result. :( – hughes Jun 17 '11 at 15:10
  • 2
    Then it's a problem with file permissions. Chmod your files to 755 or something similar. – ltamake Jun 17 '11 at 15:13
  • Gosh that's weird. My department explicitly advised setting the .htaccess file's permissions to 640, but that was the whole problem. 444 works too. Thanks! – hughes Jun 17 '11 at 15:16
  • No problem at all! :) – ltamake Jun 17 '11 at 15:16
  • 1
    @hughes the group or user of the files should have been set to the web user, but it was probably your own user. – Michael Lowman Jun 17 '11 at 19:33

For me, the problem was indeed file permissions as per Itamake's comment, so I fixed it with:

chmod -R 755 *

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.