内部服务器错误 - htaccess [英] Internal Server Error - htaccess

查看:28
本文介绍了内部服务器错误 - htaccess的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 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.

请联系服务器管理员,admin@localhost 并告知他们发生错误的时间,以及您可能做过的任何事情这可能导致了错误.

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 :

[Tue Apr 17 10:02:25 2012] [alert] [client 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 文件代码:

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!!!

那有什么问题?!!

推荐答案

Header 指令位于 mod_headers apache 模块中.您需要确保该模块已加载到 apache 服务器中.

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

这篇关于内部服务器错误 - htaccess的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆