为什么我的RewriteLog不起作用?

我有一个.htaccess看起来像这样:

RewriteEngine on RewriteLog "/Applications/MAMP/logs/rewrite_engine_log" RewriteCond %{REQUEST_URI} !/(index.php|css|images|js)/.*$ RewriteRule (.*) /mysite/index.php/$1 

当我添加RewriteLog指令时,我得到一个内部服务器错误。

在Apache日志文件中,我得到这个信息:

 /Applications/MAMP/htdocs/mysite/.htaccess: RewriteLog not allowed here 

我没有手动创buildrewrite_engine_log文件,但是我的Mac上存在path/ Applications / MAMP / logs /。 我可以尝试下一步获取RewriteEngine日志文件?

它几乎意味着它所说的。 您不能在.htaccess文件中放置RewriteLog指令。 如果你需要它,你唯一的select是把它放在服务器configuration或虚拟主机的configuration部分:

Apache的mod_rewrite手册页