views:

206

answers:

2

On my site I have mod_rewrite rules to make the URLs more search engine friendly, and it all works fine on the frontend, but I'm getting errors in the error log like this

[Thu Jan 22 22:51:36 2009] [error] [client {IP ADDRESS HERE}] File does not exist: /{some rewritten directory}

The rules I'm using are rather simple, along the lines of

RewriteRule ^pages/(.*)_(.*).html$ page.php?id=$2

Is there a way to avoid these errors?

A: 

I don't think those errors have anything to do with mod_rewrite, they're just saying that a file doesn't exist. Plain old 404 errors.

Incidentally, shouldn't rewrite patterns normally start with a slash? Like so:

RewriteRule ^/pages/(.*)_(.*).html$ /page.php?id=$2
David Zaslavsky
+1  A: 

MultiViews could cause this. If it is enabled, Apache tries to find a file similar to the requested URI before passing the request along to mod_rewrite. So try to disable it:

Options -MultiViews
Gumbo