Server internal error - htaccess

I have a htaccess file that works fine on the host, but when I put it in the local one, it shows me this error:

Internal Server Error

The server detected an internal error or an incorrect configuration and your request failed.

Contact the server administrator, admin @localhost and tell them the time when the error occurred, and anything you could do that could lead to an error.

Additional information about this error may be available if a server error occurs.

I found this warning in the error log file:

[Tue Apr 17 10:02:25 2012] [alert] [client 127.0.0.1] D: /wamp/www/jivan/sql/.htaccess: Invalid header command, possibly with an error or determined by the module not included server configuration

this is my htaccess file code:

RewriteEngine On AddDefaultCharset utf-8 RewriteRule ^([0-9-]+)/keyword_show.html$ keyword_show.php?keyword_id=$1 RewriteRule ^page_(.*).html$ page.php?url=$1 RewriteRule ^([0-9-]+)/(.*)/(.*)/(.*).html$ $2.php?advertisement_cat=$1&id=$3&pagenumber=$4 RewriteRule ^([0-9-]+)/(.*)/(.*).html$ $2.php?advertisement_cat=$1&pagenumber=$3 RewriteRule ^([0-9-]+)/(.*).html$ $2.php?advertisement_cat=$1 # cache images and flash content for one month <FilesMatch ".(flv|gif|jpg|jpeg|png|ico|swf)$"> Header set Cache-Control "max-age=2592000" </FilesMatch> # cache text, css, and javascript files for one month <FilesMatch ".(js|css|pdf|txt)$"> Header set Cache-Control "max-age=2592000" </FilesMatch> 

my local server launched wamp, and I also enabled the rewrite module !!!

so what is the question ?!

+82
.htaccess wamp
Apr 17 '12 at 5:40
source share
6 answers

The Header directive is in mod_headers apache mod_headers . You must make sure that the module is loaded on the apache server.

+121
Apr 17 2018-12-12T00:
source share

Steps to enable HEADERS modules

 $ cd /etc/apache2/mods-available $ sudo a2enmod headers $ /etc/init.d/apache2 restart 
+88
Oct 22 '13 at 6:09 on
source share

At the command line:

Install mod_headers

 sudo a2enmod headers 

and then restart apache

 service apache2 restart 
+33
May 20 '14 at 12:23
source share

Try the following:

 <IfModule mod_headers.c> Header set [your_options] </IfModule> 

Did you restart WAMP after installing / enabling?

+11
Apr 17 '12 at 5:45
source share

On Ubuntu / Debian Machine, you can simply run this command:

 sudo ln -s /etc/apache2/mods-available/headers.load /etc/apache2/mods-enabled/ 

and everything should be installed .....

+6
May 01 '14 at 21:42
source share

This answer works for me Header Set [your_options]

0
Jun 11 '19 at 11:14
source share



All Articles