g1smd - 12:42 am on Nov 22, 2012 (gmt 0)
Place a blank line after each RewriteRule so you can see each ruleset (the rule and its associated conditions) more clearly.
Apache can send it's own 404 response only when it fails to find a file on the hard drive to handle the request. In this case it always finds a file: index.php (because you have rewritten the request and are now telling Apache to handle the request by serving the index.php file) and so Apache's work is done and there's no error in its part of the operation.
The PHP script should be programmed to return the error 404 HTTP status code and a human readable error message if there is no content to deliver for the current URL request.
Change the order of your redirecting rulesets around. The index redirect ruleset needs to be listed before the non-www/www redirect ruleset.