> >Some choice has to be made when merging. If you have something such as:
> >
> ><Directory /foo>
> >PerlSetVar someKey someValue
> ></Directory>
> >
> ><Files *.thtml>
> >PerlSetVar someKey otherValue
> ></Files>
> >
> >then you issue a request for /foo/bar.thmtl. Both configuration
> >directives apply, so a decision has to be made as to which has
> >precedence. I agree with you that it's sort of arbitrary, just as the
> >opposite would be.
> 
> But my gripe is with the following:
> 
> ------docroot/.htaccess:------------
> <Files file.html>
>  PerlSetVar Lemon Tasty
> </Files>
> ------------------------------------
> ------docroot/subdir/.htaccess:-----
> PerlSetVar Lemon Sour
> ------------------------------------
> 
> Now if I request docroot/subdir/file.html, $r->dir_config('Lemon') gives me
> 'Tasty'.  It seems to me that the lower-level directory .htaccess should always
> take precedence over the higher.  I think the example you give is a useful one,
> but the rules should really only address "tiebreaking" situations, and I think
> my example isn't a tie.

It is a tie, you have two values that apply to docroot/subdir/file.html. The
choice may seem arbitrary, there's always going to be a case when you disagree
with Apache's choice. What's too bad is that Apache supplies the DIR_MERGE
routine with only the configuration data to be merged, not where they come from,
so you can't even implement your own custom directive that would merge correctly.
One solution for your particular problem would be to delete the <Files> section
and test $r->filename at request time, in a way doing your own merging in your
handler. Merging for stuff in .htaccess is done at request time anyway.

--
Eric

Reply via email to