- Code: Select all
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .* - [L]
RewriteRule .* index.php [L]
This fails with partial names. Say the following file exists on the server:
/foo/bar.jpg
And the user goes to the following URL:
/foo/bar/
The first rule above triggers (mod_rewrite thinks the file exists), and index.php is never run. Instead, the user gets a stock 404 Not Found error.
This only happens if the extension .x on the bar.x file is a known file type. If the file were /foo/bar.xxx, control passes correctly to my PHP app.
Any idea what's going on here, and how I can instruct mod_rewrite to be more specific in its checks?[/code]