Error 500 during plugin activation on a default Apache2 installation
-
Hi,
On a default Apache2 installation the plugin breaks the site with a 500 error with the following details:
Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configurationThat’s caused by the following line added to the .htaccess file by WP-Optimize:
Header append Vary User-AgentThe above line assumes that mod_headers is going to be available for any Apache2 installation, and therefore causing the error 500 if mod_headers is not available. This module is not enabled by default.
Using IfModule before the above line, as WP-Optimize does for other Apache2 modules, solves the issue:
<IfModule mod_headers.c> Header append Vary User-Agent </IfModule>A better alternative could be to remove that from the .htaccess and let WordPress take care of adding the header when the server allows it:
function wpo_add_vary_header( $headers ) { $headers['Vary'] = 'User-Agent'; return $headers; } add_filter('wp_headers', 'wpo_add_vary_header');Would be great to see any of the above fixes added to the plugin.
The topic ‘Error 500 during plugin activation on a default Apache2 installation’ is closed to new replies.