Forum Moderators: phranque

Message Too Old, No Replies

RewriteCond parameters

I need to know what this RewriteCond mean

         

asantos

5:30 am on Mar 12, 2006 (gmt 0)

10+ Year Member



I need to know what this two RewriteCond mean:

RewriteCond %{REQUEST_FILENAME}!-d
RewriteCond %{REQUEST_FILENAME}!-f

I always see them but i dont get their exact purpose.
Thanks

jdMorgan

6:04 pm on Mar 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



IF the filepath associated with the requested URL does NOT exist as a directory, and
IF the filepath associated with the requested URL does NOT exist as a file,
<THEN do something>
This can be used on sites where *all* URLs are handled by a script -- not very efficient in the case of images, external stylesheets, external JavaScripts, images, and common files such as robots.txt and custom error pages, but simple.

The use of these flags for RewriteCond is clearly described in the Apache mod_rewrite documentation [httpd.apache.org].

Jim

asantos

6:14 pm on Mar 12, 2006 (gmt 0)

10+ Year Member



Thanks for the reply Jim.
I jsut don't get why you say that if i handle the url with a php script it won't be efficient with images/js/etc...

The "RewriteCond %{REQUEST_FILENAME}!-f" will filter any existing file call after all, right?