Eric S. Johansson wrote:

>>   I want to introduce you one of the new features in which I have
>>   been working for the next release..
>>
>>   The target was to clean up a little bit the syntax of the Request
>>   entries. In 0.4.29 it works like:
>>
>> =============
>>   Request "^/dir1/.*/file$" {
>>     Handler redir {
>>       Rewrite "^/dir1/(.*)/file$" "http://example.com/$1";
>>     }
>>   }
>> =============
>>
>>   In the next release, it will support the previous configuration
>>   entry and this new syntax which, in my opinion, makes much more
>>   sense:
>>
>> =============
>>   Request "^/dir1/(.*)/file$" {
>>     Handler redir {
>>       Rewrite "http://example.com/$1";
>>     }
>>   }
>> =============
>>
>>   It is also slightly faster than the previous one (it needs to parse
>>   one regular expression less).
>>
>>   Comments? Ideas? :-)
>
> maybe I stayed a little overly long day at a Boxing Day party but
> something doesn't strike me as quite right.
>
> Looking in the documentation http://www.0x50.org/doc/Redirections.html
> it looks like you want the input of the rewrites sequence to be the
> shortened form of the name and the output to be a longer form of the
> name.  Whereas it looks like your example has it backwards (i.e. longer
> URL to shortened form).  I'm going to assume I'm missing something obvious.

  Basically the hack allows to add matching groups to the Request
  regular expression. Then, if the Rewrite rule inside the redir
  handler includes only the final destination, it will use the regions
  which were matched in the Request header.

  It doesn't need to compile and test two regular expressions in order
  to match a Request, one is enough for most of the cases :)

--
Greetings, alo.
http://www.alobbs.com
_______________________________________________
Cherokee mailing list
[email protected]
http://www.alobbs.com/cgi-bin/mailman/listinfo/cherokee

Reply via email to