Invalid command ‘Header’, perhaps misspelled or defined by a module not included in the server configuration

You have this error message on your apache logs

/home/www/.htaccess: Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration

Check the .htaccess file and there is no Header command…

<FilesMatch "\.(xml|jpg)$">
FileETag None
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</FilesMatch>

In fact, this issue is due to the header apache’s module whose’s missing.
To install it, run

a2enmod headers

And don’t forget to restart apache

service apache2 restart

Leave a Reply