How to solve “ExpiresActive not allowed here” error message in .htaccess file?

On a general note, the simplest way to deal with issues like this is referring to the manual.

http://httpd.apache.org/docs/1.3/mod/mod_expires.html#expiresactive

Syntax:      ExpiresActive On|Off
Context:     server config, virtual host, directory, .htaccess
Override:    Indexes
Status:      Extension
Module:      mod_expires

The two fields of interest it Context and Override. As we can see its OK to use ExpiresActive in an .htaccess file aslong as you AllowOverride Indexes

Update:

To address your need for expire headers. Check out https://stackoverflow.com/questions/1036941/setup-expires-headers-php-apache

Hope this helps:)

Leave a Comment