Posted on 2010-04-05 19:49
BZ 閱讀(1356)
評論(2) 編輯 收藏 所屬分類:
Misc
在使用Access File時,頁面出現500 Internal Error. 檢視Apache錯誤日志是發現: .htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration.
Google后才發現, RewriteEngine命令需要rewrite mod的支持。從而, 做如下修復:
$>cd /etc/apache2/mods-enabled 切換到apache下的mods-enabled目錄
$>sudo ln -s ../mods-available/rewrite.load rewrite.load 啟用rewrite mod
$>sudo /etc/init.d/apache2 restart 重啟apache服務器
注:rewrite.load的內容為: LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so 也就是加載mod_rewrite模塊。