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 read a lot of server error 500 questions related to the famous .htaccess file but I have still not found an answer to this error.

I have a folder which I used to test the .htaccess file.


I copied the .htaccess in the example folder and I get server error 500

my .htaccess file contains this:

<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType image/png "access plus 1 days"

I have changed my httpd.conf file:

all AllowOverrride None to AllowOverride All i have also uncommented this line:

LoadModule expires_module modules/mod_expires.so

error.log says: ExpiresActive not allowed here

I still get the error 500

What is actually happening? How can I resolve this error?

PS: i am running on localhost with XAMPP

share|improve this question
can you paste your htaccess file and also an excerpt of your apache error log –  anthonysomerset Mar 21 '11 at 16:37
This is in the .htaccess file: # This folder does not require access over HTTP # (the following directive denies access by default) Order allow,deny where can i find the Apache error log? –  welou Mar 21 '11 at 16:39
depends where you installed apache to, on most linus systems its found in /var/log however windows i am not sure it will be wherever you installed apache to though, also you may want to check your vhost has the AllowOverride all directive for the site –  anthonysomerset Mar 21 '11 at 16:42
This is what i have in my .htaccess file now... RewriteEngine On RewriteRule ^(([^/]+/)*[^.]+)$ /$1.php [L] I noticed something strange..when remove everything in the .htaccess file..i can access the files in "example" folder but as soon as i add anything like even a "#" comment..i gives the 500error. –  welou Mar 21 '11 at 16:43
can you tell me the file name?..maybe if i know what's the file name i'll be able to change the allowOverride all directive... –  welou Mar 21 '11 at 16:44

1 Answer 1

It looks like your syntax may be slightly wrong

according to the mod_expires page: http://httpd.apache.org/docs/2.2/mod/mod_expires.html your code should read:

<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/png "access plus 1 days"

please note the case difference

also make sure your AllowOverride directive is contained in the same directory block as defines your webroot and dont forget to restart apache when you make the changes so it will reload your configuration, also make sure there are no other different AllowOverride directives that may be intefering

share|improve this answer

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.