Kurt McKee wrote:
>> I don't think Alvaro is proposing to elimiate the current way
>> redirs work, rather just add functionality.
>
> This doesn't appear to be the best fix, at least for the problem
> I've been experiencing - it seems to me that redirection should
> always occur first in the given Directory statement, because the
> requested URL is obviously not the final destination. In that
> situation, it seems that the redir Handler should be given the first
> shot at matching and redirecting the URL, and then later Handler
> statements are given precedence afterward.
Ok, I understand your point, but I don't agree. Let me explain the
reasons:
Handlers are only content generator for the web. All of them are
equipotent, basically because there is not a way to set a precedence
order, and because it wouldn't make much sense anyway.
I do agree there is a problem to be solved even with the addition of
the Request clause. Your example of .py files was pretty good to
describe it.. (even if there is a work around for it):
===
Request "/src/*.py" {
Handler file
}
===
It seems like the way to go is not to use a pre-set precedence order
between Directory, Extension and Request entries. If we figure out
how to allow the user to define the precedence for each individual
case the global problem should be sorted out.
I propose to use the same precedence as the definition of the
entries in the configuration file: first entries have more priority.
In this way, we could solve all the problems.
For example, for the problem you exposed, it should be enough:
===
Directory /src {
Handler file
}
Extension py {
Handler python
}
===
As long as the directory entry has a higher priority (it is defined
in the first place) the contents will be send using the handler
file, even if they are .py files: the extension entry will not have
enough priority to overwrite the handler value.
Thoughts? :-)
--
Greetings, alo.
_______________________________________________
Cherokee mailing list
[email protected]
http://www.alobbs.com/cgi-bin/mailman/listinfo/cherokee