On Tue, Jan 17, 2012 at 10:02 AM, André Warnier <a...@ice-sa.com> wrote: > But isn't there an error in the examples shown ? > > RewriteCond /your/docroot/dir1/%{REQUEST_FILENAME} -f > RewriteRule ^(.+) /your/docroot/dir1/$1 [L] > > If the original URL is e.g. "/cgi-bin/myscript.pl", and I wanted to check > the local directory "/cgi-local" first, then this would evaluate to > > RewriteCond /my/docroot/cgi-local/myscript.pl -f > but the "^(.+)" of the second line would evaluate to "/cgi-bin/myscript.pl" > which would give a final URL of : > "/my/docroot/cgi-local/cgi-bin/myscript.pl" > which is probably not what I want.
It's kind of out-of-scope for the mod_perl list, but I think REQUEST_FILENAME is the whole path. Check the docs. Regardless of the details, you seem to grasp how to make it work using a -f RewriteCond, so play around with it until you get what you want. - Perrin