6

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.

hughes
  • 161
  • 1
  • 1
  • 4
  • 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

2 Answers2

7
Order Allow,Deny
Allow from all
iamandrus
  • 186
  • 2
  • Okay, tried that. Same result. :( –  Jun 17 '11 at 15:10
  • 2
    Then it's a problem with file permissions. Chmod your files to `755` or something similar. –  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! –  Jun 17 '11 at 15:16
  • No problem at all! :) –  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
1

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

chmod -R 755 *
eddygeek
  • 113
  • 4