Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WAMP .htaccess gives Internal Server Error after moving from XAMPP

Not long ago, I moved from xampp to wamp
And now when I entered my website this error has appeared:

Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log.

When I used this code in .htaccess:

<FilesMatch "\.(pdf|swf|js|css)$">
    Header set Cache-Control "max-age=604800"
</FilesMatch>

<FilesMatch "\.(html|cgi|php|htm)$">
    Header set Expires "Thu, 01 Dec 2003 16:00:00 GMT"
    Header set Cache-Control "no-store, no-cache, must-revalidate"
    Header set Pragma "no-cache"
</FilesMatch>


AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html

<Files *.js>
    SetOutputFilter DEFLATE
</Files>

<Files *.css>
    SetOutputFilter DEFLATE
</Files>  

How can I fix this problem?


I found apache_error.log:

[Sat Jan 07 13:58:06 2012] [alert] [client 127.0.0.1] C:/wamp/www/website/.htaccess: Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration, referer: localhost

like image 271
user1123379 Avatar asked Jan 07 '12 12:01

user1123379


1 Answers

As XP1 said, the answer to this is to enable headers_module in WAMP.

Either use the WAMP interface or add this to your httpd.conf

LoadModule headers_module modules/mod_headers.so
like image 121
Rob Forrest Avatar answered Oct 15 '22 13:10

Rob Forrest