I'm trying to catch every URL and rewrite it to index.php. I have the following code in my .htaccess right now:
RewriteEngine on
RewriteRule .* index.php
It does rewrite every URL, but I always get a 404 saying the index.php file cannot be found. The path it is looking for the file is correct though. What am I doing wrong here?
Update 1
When I directly browse to index.php, it does correctly display the file. Very strange.
Update 2
I turned on logging for mod_rewrite using this in httpd.conf:
RewriteLog /var/log/apache2/rewrite.log
RewriteLevel 3
This is what it logged:
strip per-dir prefix: /Users/rits/Sites/test/ ->
applying pattern '.*' to uri ''
rewrite '' -> 'index.php'
add per-dir prefix: index.php -> /Users/rits/Sites/test/index.php
internal redirect with /Users/rits/Sites/test/index.php [INTERNAL REDIRECT]