mod_rewrite不工作 - 导致404错误,没有日志

I’m running localhost XAMPP on my Mac and trying to setup the Apache server with mod_rewrite, here’s my code in .htaccess (which is in htdocs)

<IfModule mod_rewrite.c>

    RewriteEngine On                                        # Turn on the rewriting engine
    RewriteRule ^test/?$ api/rest/v1.0/api_controller.php?request=$1 [NOCASE,LAST]      # Handle requests for “test"

    RewriteLog "logs/rewritelog"
    RewriteLogLevel 7

</IfModule>

This is the only code in the .htaccess file too.

When I try my link http://localhost/test/1 in my browser, I just get directed to a 404 error.

I’ve checked under htdocs/logs/rewritelog but there aren’t any files nor even a folder called logs.

UPDATE

I’m running Apache version 2.4.10

So it turns out the .htaccess file was saved as .htaccess.txt where the .txt extension was hidden. If you get the same error, check the file in Get Info.