Ken Williams wrote:
> I've done some more digging, and found a rather bizarre explanation.  As it
> turns out, if the parent .htaccess has its directive in a <Files> section and
> the subdirectory doesn't, the parent will override the child.  If they're
> specified the same way, the child will override the parent.
> 
> The worst part is that this is _documented_ and supposedly correct:
>    http://www.apache.org/docs/sections.html
> 
> Seems kind of ridiculous - why should the method we use to specify behavior
> have any effect on precedence?  I feel like I'm probably missing something
> here, there's probably some reason for this behavior that I'm not thinking of.

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.

> In any case, it seems to make some kinds of configuration almost impossible to
> achieve.  For instance, I can't figure out for the life of me how to set
> directives for all files in a directory (but not its subdirectories) ending in
> a certain extension.  

Yep, I don't think you can even get away with custom directives since even though
you'd control the merging routine in that case, you still wouldn't know where the
configuration comes from to make your merging decision (IMHO a major drawback in
Apache's merging scheme, unless I've overlooked the obvious).

> 
> [EMAIL PROTECTED] (Ken Williams) wrote:
> >Hi,
> >
> >I'm wondering about a precedence issue with PerlSetVar.  Suppose I have the
> >following setup:
> >
> >  in docroot/.htaccess:
> >      PerlSetVar Lemon Tasty
> >  in docroot/dir/.htaccess:
> >      PerlSetVar Lemon Sour
> >
> >Which one is supposed to be present when I request, say,
> >docroot/dir/file.html? My intuition tells me that
> >$r->dir_config("Lemon") should be "Sour", but experimentation is giving
> >me strange results.  In some cases the subdirectory takes precedence,
> >in others the parent directory does.
> >
> >What's the standard here?

You're correct, other PerlSetVar's not withstanding, mod_perl's default
merging routine will overlay Tasty with Sour.

> 
>   -------------------                            -------------------
>   Ken Williams                             Last Bastion of Euclidity
>   [EMAIL PROTECTED]                            The Math Forum
> 
> 


--
Eric

Reply via email to