Php – 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 "\.(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"

AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html

<Files *.js>
    SetOutputFilter DEFLATE

<Files *.css>
    SetOutputFilter DEFLATE

How can I fix this problem?

I found apache_error.log:

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

Best Solution

In wamp server click on apache ,apache modules and click(mark) on the rewrite_module and restart wamp server your problem is solved

Related Question