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 have a .htaccess file that isn't working. I know it's not working because i wrote random things in it and i am not getting a 500 error. Even when i write proper code it doesn't work. I have verified that is in my root directory and has the proper file name. Here is the directory "tag" from http.conf:

<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
</Directory>

I used <?php phpinfo(); ?> and verified that mod_rewrite is enabled, but still no luck.

share|improve this question
    
Anything useful in the Apache error log? –  Shane Madden Jan 20 '12 at 2:36
    
@ShaneMadden how do i do that. im not getting any error when i run my htaccess in my directory. the pages load like normal –  user176105 Jan 20 '12 at 2:38
    
Open the Apache error log and look for any errors that are relevant. The log's location is variable based on how it was installed and what system you're on. –  Shane Madden Jan 20 '12 at 2:40
    
@ShaneMadden it seems that ive gotten about a hundred errors and all of them are the same thing. "[Thu Jan 19 21:50:56 2012] [error] [client 127.0.0.1] File does not exist: /Library/WebServer/Documents/favicon.ico" –  user176105 Jan 20 '12 at 2:57

1 Answer 1

I wonder if that Deny from all might be the problem. If Apache knows it's going to send a 403 response, it might not even bother reading the .htaccess file.

Other potential problems could include a typo in the name of the .htaccess file (although you did say you'd checked this), a different AccessFileName value to normal and file/directory permissions on any of the directories leading up to your DocumentRoot.

It might be worth using strace to verify that Apache is actually reading your .htaccess file. Make sure Apache is stopped then start it this way:

sudo strace -f -e open apache2 -X

Then make your request again.

share|improve this answer

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.