Welcome to WebmasterWorld Guest from 184.108.40.206
I'm trying to control the caching of my web content by adding the ExpiresActive directive to the .htaccess file in the /public_html directory of my site.
I put the following lines (straight from the Apache manual) into the .htaccess file but get the dreaded Internal Server Error.
ExpiresByType image/gif A2592000
ExpiresByType text/html M604800
In fact, just placing the line 'ExpireActive On' into .htaccess results in an error.
Here's the the error log entry:
[Sat Jul 26 16:09:57 2003] [alert] [client 220.127.116.11] /home/dondle/public_html/.htaccess: Invalid command 'ExpiresActive', perhaps mis-spelled or defined by a module not included in the server configuration
My host provider, running Apache 1.3, says that the mod_expires and mod_headers modules are installed into httpd and says he doesn't know what the problem might be since he is not familiar with the mod_expires directives. Are there any other possible causes?
do you have a ExpiresDefault directive defined?
also, is the server owner absolutely sure that mod_expires is loading? the errormessage in the log indicates that the module is not loading since it is obvious that you haven't misspelled it...
Thanks for getting back.
What can I tell the web host to look for to verify that it's loading? He says they recompiled the modules into the http daemon for me and that everything looks good from their end.
How would I be sure taht the 'ExpiresDefault' directive is defined?
Unfortunately, I've only briefly run Apache on an old Debian Linux box I had. I really don't know much about administering it. The web host will give me jail shell access. Maybe I could use that to look at the appropriate .conf files...if I knew what they were. :(
httpd -l (that's an ell not a one)
is the one... just found it on the apache.org site...
otherwise, it should be listed in the httpd.conf file as a lodable module instead of being compiled in... generally the syntax is
LoadModule expires_module modules/mod_expires.so
(the above is for a *nix shared object version of the module)
if they do have the module compiled into the server, it still may not be active... that would be done like this...
in the conf file...
the expiresdefault directive can be set in your .htaccess file...
generally the conf file is /etc/httpd.conf on most *nix systems... but it can be anywhere and called anything because another of those command line parameters sets the config file to use 8)
in any case, until you can get it to stop telling you that the word is undefined, your task is to get the module loaded and active...
you may find additional info over at [httpd.apache.org ]... its where i was looking to verify some of the info above...
Although it's possible to control expiration headers with server-side scripting, the overhead and the trouble make it really not worth it.