Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Cherokee: dev

Substitution on regular expression rule

 

 

Cherokee dev RSS feed   Index | Next | Previous | View Threaded


aperez at skarcha

Jan 23, 2010, 4:47 AM

Post #1 of 3 (264 views)
Permalink
Substitution on regular expression rule

Hi!

I have a regular expression rule with this value:

^/[^/]*/chrome/common

That rule set document rule as:

/usr/local/lib/python2.6/dist-packages/Trac-0.11.6-py2.6.egg/trac/htdocs

The problem here is that document root is merged with the full request:

========================
handler_file.c:0102 ( cherokee_handler_file_new): Connection
0x25df290 info
| Request: '/tractest2/chrome/common/css/trac.css' (37)
| Request Original: '/tractest2/chrome/common/css/trac.css' (37)
| Web Directory: '' (0)
| Local Directory:
'/usr/local/lib/python2.6/dist-packages/Trac-0.11.6-py2.6.egg/trac/htdocs'
(72)
| Pathinfo: '' (0)
| User Dir: '' (0)
| Query string: '' (0)
| Query str. Orig.: '' (0)
| Host: 'domain.tld' (14)
| Redirect: '' (0)
| Redirect num: 0
| Keepalive: 499
| Chunked-Encoding: 0
| Phase: Setup connection
| Range start: -1
| Range end: -1
| Rate: 0
| Option bits: document_root
\_
connection.c:2292 (cherokee_connection_open_request):
web_directory='' request='/tractest2/chrome/common/css/trac.css'
local_directory='/usr/local/lib/python2.6/dist-packages/Trac-0.11.6-py2.6.egg/trac/htdocs'
iocache.c:0585 ( cherokee_iocache_autoget):
file=/usr/local/lib/python2.6/dist-packages/Trac-0.11.6-py2.6.egg/trac/htdocs/tractest2/chrome/common/css/trac.css
========================

But I would like to remove the "/tractest2".

What do you think about to implement that feature on "regular expression" rule?

--
Saludos:
Antonio Pérez
_______________________________________________
Cherokee-dev mailing list
Cherokee-dev [at] lists
http://lists.octality.com/listinfo/cherokee-dev


alvaro at octality

Jan 29, 2010, 4:38 AM

Post #2 of 3 (234 views)
Permalink
Re: Substitution on regular expression rule [In reply to]

On 23/01/2010, at 13:47, Antonio Pérez wrote:

> I have a regular expression rule with this value:
> ^/[^/]*/chrome/common
>
> That rule set document rule as:
> /usr/local/lib/python2.6/dist-packages/Trac-0.11.6-py2.6.egg/trac/htdocs
>
> The problem here is that document root is merged with the full request:
> /usr/local/lib/python2.6/dist-packages/Trac-0.11.6-py2.6.egg/trac/htdocs/tractest2/chrome/common/css/trac.css

My proposal would be:

Directory: /chrome/common
- Document root: /usr/local/[...]/htdocs
- Handler: Static Content

Regex: ^/.*?/(chrome/common.*)
- Handler: Internal Redir: /$1

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

_______________________________________________
Cherokee-dev mailing list
Cherokee-dev [at] lists
http://lists.octality.com/listinfo/cherokee-dev


aperez at skarcha

Feb 1, 2010, 2:56 AM

Post #3 of 3 (230 views)
Permalink
Re: Substitution on regular expression rule [In reply to]

Hi!

2010/1/29 Alvaro Lopez Ortega <alvaro [at] octality>:
> On 23/01/2010, at 13:47, Antonio Pérez wrote:
>
>> I have a regular expression rule with this value:
>> ^/[^/]*/chrome/common
>>
>> That rule set document rule as:
>> /usr/local/lib/python2.6/dist-packages/Trac-0.11.6-py2.6.egg/trac/htdocs
>>
>> The problem here is that document root is merged with the full request:
>> /usr/local/lib/python2.6/dist-packages/Trac-0.11.6-py2.6.egg/trac/htdocs/tractest2/chrome/common/css/trac.css
>
> My proposal would be:
>
> Directory: /chrome/common
>    - Document root:  /usr/local/[...]/htdocs
>    - Handler:        Static Content
>
> Regex: ^/.*?/(chrome/common.*)
>    - Handler:        Internal Redir: /$1

Works like a charm! :-)

Good point Álvaro, it's a good option, as always... :)

Thanks!


--
Saludos:
Antonio Pérez
_______________________________________________
Cherokee-dev mailing list
Cherokee-dev [at] lists
http://lists.octality.com/listinfo/cherokee-dev

Cherokee dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.