I'm helping a friend's web site that has a large number of blog entries. The problem I'm having is that whoever set it up originally allowed the use of spaces in the filenames of the jpg's. There are over 20,000 jpg's on the site that have names like "picture of tree.jpg".
The problem comes from $_SERVER['REQUEST_URI'] adding %20 to the spaces. The server displays the correct file for the request but every single jpg request is showing up in the error log as "File does not exist: /path/picture%20of%20a%20tree.jpg" even though the proper file is displayed.
I know the right solution is to rename the jpg's but there are so many plus the links to them that it would be overwhelming. Is there a mod rewrite I can use in htaccess to stop these requests from ending up in the error log? There are so many "File does not exist" entries that it's nearly impossible to find other errors.