内部服务器错误 - htaccess的错误、服务器、htaccess

2023-09-02 00:31:30 作者:此间滋味与谁人

我有它完美地工作在主机htaccess的文件,但是当我把它放在本地,那就说明我这个错误:

I have a htaccess file that it work perfectly on host but when I put it on local ,it shows me this 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.

我发现这个警报在错误日志文件:

I found this alert in error log file :

[星期二04月17日10点02分25秒2012] [警惕] [客户127.0.0.1] D:/wamp/www/jivan/sql/.htaccess:无效的命令'头',也许拼错或模块中定义不包括在服务器配置

[Tue Apr 17 10:02:25 2012] [alert] [client 127.0.0.1] D:/wamp/www/jivan/sql/.htaccess: Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration

这是我的htaccess的文件code:

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>

我的本地服务器通过WAMP运行,我启用了重写模块过!

my local server run by wamp and I enabled rewrite module too!!!

所以什么`的概率?!

推荐答案

标题指令是在 mod_headers中 Apache模块。你需要确保模块被加载到阿帕奇服务器。

the Header directive is in the mod_headers apache module. You need to make sure that module is loaded into the apache server.