Aller au contenu | Aller au menu | Aller à la recherche


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

[core:alert] /var/www/mywebsite/.htaccess: Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration

To simply solve this problem, use the following two commands for add the required and currently missing Apache module:

  1. a2enmod headers # Enabling headers Module
  2. apache2ctl restart # Restarting Apache

/var/www/mywebsite/.htaccess:

<FilesMatch ".+">
    ForceType application/octet-stream
    Header set Content-Disposition attachment
</FilesMatch>
root@ks:~# a2en
a2enconf  a2enmod   a2ensite
root@ks:~# a2enmod headers
Enabling module headers.
To activate the new configuration, you need to run:
  service apache2 restart

root@ks:~# apache2ctl configtest
Syntax OK

root@ks:~# apache2ctl restart

root@ks:~# l /etc/apache2/mods-enabled/
...
headers.load -> ../mods-available/headers.load
...

Ajouter un commentaire

Le code HTML est affiché comme du texte et les adresses web sont automatiquement transformées.

Fil des commentaires de ce billet