I have the following .htaccess file:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule api/(.*)$ api.php?m=$1 [QSA,NC,L]
</IfModule>
The URL rewriting works great. I can go to http://myserver.com/api/example and it will behave as if I went to http://myserver.com/api.php?m=example. The problem is that the PHP $_REQUEST and $_GET variables are empty. Shouldn't I still be able to get the value of $_REQUEST['m']?
After some googling, I found a suggestion to disable MultiViews. If I add Options -MultiViews
, I get a 404 error.
What am I doing wrong? Thank you.