* Chris Darroch <[EMAIL PROTECTED]> wrote:

>    What I noticed was that prefix_stat() seems to implement a
> heuristic that attempts to decide whether or not the URI has been
> mapped out of the document root, because if it hasn't, then the
> document root needs to be prepended to the URI and written into
> r->filename. 

Yes.

>    My inclination would be -- although I realize this might cause
> painful problems for admins upgrading Apache -- to eliminate this
> source of confusion and potential mischief by removing prefix_stat()
> and the logic around it, and instead always prepending the
> document root in hook_uri2file(), unless a specific rule configuration
> flag was used, maybe "A" for "alias"?  (This would be unrelated
> to the passthrough mode, where hook_uri2file() munges r->uri and
> then returns DECLINED; this would relate to the normal case of
> returning OK to end the translate_name phase.)

I've had the same idea for some time, but never got some time to spare.
However:
 - It's for 2.1 and later. I wouldn't touch the stable branches; further 
mod_rewrite
   in 2.1 should be easier to edit, because it was refactored a bit.
 - I'd make it configurable (but defaulting to the new variant); i.e. some 
option
   for RewriteOptions
 - The same thing applies for automatic userdir resolution, I'd introduce
   an 'U' flag or the like.

>    This obviously means a fair bit of coding work, especially
> since I'm not sure what it would entail in relation to rewrites
> done in a per-directory context -- maybe nothing?

Yep, dir context is not affected.

>    Thoughts, comments, criticisms, errors in the above?

Comment:
You're describing the darkest one of the black mod_rewrite magic. ;-)

nd

Reply via email to