为什么我的RewriteLog不起作用?


9

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

我没有手动创建该rewrite_engine_log文件,但是该路径/ Applications / MAMP / logs /在我的Mac上存在。接下来我可以尝试什么来获取RewriteEngine日志文件?

Answers:


18

它几乎说明了它的意思。您不能将RewriteLog指令放在.htaccess文件中。如果需要,唯一的选择是将其放在服务器配置或虚拟主机的config部分中:

apache的mod_rewrite手册页


该服务器配置在哪里?
openfrog

我不在Mac上,但我认为它位于/Applications/MAMP/conf/apache/httpd.conf
muffinista
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.