我有一个 .htaccess 看起来像这样:
RewriteEngine on
RewriteLog "/Applications/MAMP/logs/rewrite_engine_log"
RewriteCond %{REQUEST_URI} !/(index.php|css|images|js)/.*$
RewriteRule (.*) /mysite/index.php/$1
Run Code Online (Sandbox Code Playgroud)
当我添加该 RewriteLog 指令时,我收到内部服务器错误。
在 Apache 日志文件中,我得到以下信息:
/Applications/MAMP/htdocs/mysite/.htaccess: RewriteLog not allowed here
Run Code Online (Sandbox Code Playgroud)
我没有手动创建该 rewrite_engine_log 文件,但该路径 /Applications/MAMP/logs/ 存在于我的 mac 上。接下来我可以尝试什么来获取 RewriteEngine 日志文件?
当地址栏中有类似“localhost:80”的内容时,我发现在我的本地站点上工作很混乱。如果可能的话,最好有像“mydomainoffline.com”这样的东西,然后以某种方式映射到“localhost:80”。我将如何在 MAC 上做到这一点?
我使用免费的 MAMP 包 ( mamp.info ),而不是商业 MAMP PRO。所以我需要手工做那种事情。我怎样才能做到这一点?