Firstly, sorry for the top post ... according to Apache.org :-
"'-F' (is existing file, via subrequest) Checks whether or not TestString is a valid file, accessible via all the server's currently-configured access controls for that path. This uses an internal subrequest to do the check, so use it with care - it can impact your server's performance!" (http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html) This warning is related to the "F" flag and not "f" as Tom mentioned; surely if there was a performance issue with "f", it would be documented as it is for "F". I would say that performance-wise, Tom's suggestion would be the best (compared to my random hack suggestion anyway!). Richard. ________________________________ From: Andrew Hole [mailto:andremailingl...@gmail.com] Sent: 26 August 2009 15:24 To: users@httpd.apache.org Subject: Re: [us...@httpd] Handling 404 errors Your solutions looks very useful, but i'm afraid about impact on server performance. Do you have any idea about the impact on performance? Thanks a lot On Wed, Aug 26, 2009 at 2:59 PM, Tom Evans <tevans...@googlemail.com> wrote: On Wed, 2009-08-26 at 12:23 +0100, Andrew Hole wrote: > Hi guys! > > Actually our web application has a retry mechanism based on http > status code returned to client. Just an example: > - An http request is made to http://web/software_A_folder/file.swf > - if the file doesn't exist (http 404) on software_A_folder, the > request is made in core folder: http://web/core/file.swf > > This mechanism is used on entire application: when a file doesn't > exist on software_x_folder, a retry is made on core folder. > > In terms of Apache, this mechanism make always 2 requests (in case of > file not found). > > What I want to know is if there are any option on Apache to handle 404 > status code without retry the request. When file not found, some logic > will handle the 404 and return the file located on other folder. > > I appreciate your help. > > Best Regards, > A. This looks like a simple rewrite rule surely? RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} ^/software_A_folder/(.*) RewriteCond %{DOCUMENT_ROOT}/core/%1 -f RewriteRule ^/software_A_folder/(.*) /core/$1 [L] Cheers Tom --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org " from the digest: users-digest-unsubscr...@httpd.apache.org For additional commands, e-mail: users-h...@httpd.apache.org ********************************************************************** Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you must not copy, distribute or take any action in reliance to it. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer do not consent to Internet email for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of Minorplanet Systems plc shall be understood as neither given nor endorsed by it. Minorplanet Systems plc, Registration no: 3372097 Minorplanet Limited, Registration no: 4072786 Greenwich House, 223 North Street, Leeds, LS7 2AA VAT #: 698 1438 86 **********************************************************************