Hello,
I disagree that adding a "Requests" directive would solve the problems
you've described. I see that there could be some benefit, but it seems
to me that a consistent precedence scheme for Handlers would be more
sensible. For instance, you wrote:
# Example 2:
#
Request "/trackback/.+php" {
Handler redir {
Rewrite "/(.+)\.php$" "/index.php?tb=1&name=$1"
}
}
It appears to me that, in this case, the functionality of the redir
Handler has been abstracted up into a Request in order to have
precedence over existing Directory and Extension directives. Further,
every Rewrite has to be nested in both a Request and a Handler, and the
regular expressions have to be crafted for both the Request and the Rewrite.
I also disagree with the precedence rules you've suggested:
1.- Requests
2.- Extensions
3.- Directories
Requests could very well be placed at the top of the list. However, I
think that Extension and Directory will lead to conflicts. For instance,
Python scripts may end with .py, and be used for the application
backend. However, source code may be available in certain download
directories. The Directory statement says "handle /src with the file
handler" while the Extension statement says "treat all .py files as cgi
scripts".
It appears to me that certain file extensions could be wrapped in with
the "common" Handler. Most .php files should probably be run as scripts,
rather than served as source code files.
I would propose a precedence for the Handlers first, at least before
implementing a Request directive. I would further propose that the rules
be based on the Handlers' respective orders in the Directory directive,
so that rules such as these will work:
Directory / {
Handler redir {
Rewrite "/archives/ .. " "something"
Rewrite "/trackback/ .. " "whatever"
}
Handler phpcgi
Handler common
}
I think I would agree that Directory is being abused. I don't have any
thoughts yet about John's problems, and I'm not sure I even understand
the issue. But it seems to me that allowing the order of the Handlers to
imply precedence would be more immediately helpful than a new Request
directive.
Respectfully,
Kurt McKee
_______________________________________________
Cherokee mailing list
[email protected]
http://www.alobbs.com/cgi-bin/mailman/listinfo/cherokee