Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

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
add comment

1 Answer

up vote 4 down vote accepted
Order Allow,Deny
Allow from all
share|improve this answer
    
Okay, tried that. Same result. :( –  hughes Jun 17 '11 at 15:10
1  
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
    
@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
add comment

Your Answer

 
discard

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.