Apache Expires Header using mod_headers and htaccess

duane's picture

I needed to add an expires header to an apache 1.3.x instance and the mod_expires module was not included in the build. However, I noticed (using httpd -v) that mod_headers was included.

The following syntax is one way to set the Expires HTTP header in the .htaccess file.
Header set Expires "Thu, 16 Apr 2015 21:55:00 GMT"

The downside is that the value is fixed in this case rather than using the mod_expires dynamic syntax such as: plus 30 days.