Hello Matthew,

On 04/01/2011, at 21:01, Matthew Haas wrote:

> But as I said, from what I can tell, all rules seem to be falling through and 
> hitting default. I would expect (again, I'm likely missing some fundamental 
> understanding of cherokee rules) that if I'm trying to access main/, it hits 
> the doku.php in the root (which I configured as an index) and should be happy 
> with that rule...
> 
> Any suggestions?

Cherokee follows a fairly straightforward process while processing requests. As 
a very brief summary:

- The first thing it does is to find the virtual server in charge of processing 
the request. The request is evaluated against the virtual server list from top 
to bottom (mind the order). As soon as a virtual server matches, the evaluation 
stops.

- Once the virtual server has been chosen, the request is evaluated against the 
virtual server's behavior list. Again, the evaluation is perform in order - 
from the top of the list to the bottom.  Whenever a rule matches, it's 
definitions are applied (authentication, handler, caching properties, custom 
document root, etc). The evaluation stops when a 'Final' rule is matched, or 
the 'default' rule (the last) is hit.

- Then, the request is processed according with the parameter collected during 
from the behavior rules.

The best way to write these rules is to think how the different requests will 
match through the behavior list, and what properties are being set along the 
way.

Regarding the redirections/regular expression, it's important to notice that 
they are match against the request rather than against the full URL. Bare that 
in mind whenever you add regexs. Actually, since the virtual server matching is 
performed in an early processing stage, it would not make much sense to include 
in the request processing phase, would it?.

I know it might be kind of uncomfortable to change the mindset to fit these 
little differences at first. It is a much logical (and thus, natural) way to 
define and maintain the behavior of a Web Server. It does only require a while 
to forget the old habits and get used to it.

Good luck.
Cheers!

--
Octality
http://www.octality.com/

_______________________________________________
Cherokee mailing list
[email protected]
http://lists.octality.com/listinfo/cherokee

Reply via email to