php - WAMP .htaccess 在从 XAMPP 移动后出现内部服务器错误

标签 php .htaccess wamp wampserver

不久前,我从xampp转到了wamp
现在当我进入我的网站时出现了这个错误:

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.

当我在 .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>  

我该如何解决这个问题?


我找到了 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

最佳答案

在 wamp 服务器中单击 apache、apache 模块并单击(标记)rewrite_module 并重新启动 wamp 服务器,您的问题已解决

关于php - WAMP .htaccess 在从 XAMPP 移动后出现内部服务器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8769799/

相关文章:

php - 将数据以加密形式存储在数据库中,并检索

PHP获取字符串中每个第一个字符的位置到数组中

php - 我如何在 yii 模块中添加脚本和样式表

apache - 如何根据域有条件地向 Apache .htaccess 添加一行?

yii - 在 Yii 应用程序中运行单元测试的 fatal error

javascript - Ajax 发布到远程 php 文件不适用于phonegap

apache - 重定向到 rtmp 协议(protocol)时,RewriteRule 将子文件夹附加到 url

php - codeigniter 无法在 Linux 上运行

css - Apache 别名不起作用,WAMP

php - WAMP: "' php' 未被识别为内部或外部命令可运行程序或批处理文件”,尽管添加了 PATH