.htaccess: Invalid command 'RewriteEngine', perhaps misspelled o r defined by a module not included in the server configuration, referer:

環境

  • MacOSX 10.11
  • Homebrew 0.9.5 (git revision 9942; last commit 2015-11-07)
  • Apache/2.4.17


課題

500 Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. が発生。

/usr/local/var/log/apache2/error_logには下記のログが吐かれている。

.htaccess: Invalid command 'RewriteEngine', perhaps misspelled o r defined by a module not included in the server configuration, referer:


対策

Apacheのconfファイル /usr/local/etc/apache2/2.4/httpd.confを開き、#LoadModule rewrite_module modules/mod_rewrite.soコメントアウトを外し、Apacheの再起動を行う。


結果

解決。


http://httpd.apache.org/docs/current/mod/mod_rewrite.html

http://blog.goo.ne.jp/xmldtp/e/8be7301e815e57a347903fea26b34903