um, maybe something like parts of the hostname, counting from the last one,
like this:

for "subdomain1.subdomain2.maindomain.com"

${hostpart0} == 'com'
${hostpart1} == 'maindomain'
${hostpart2} == 'subdomain2'
${hostpart3} == 'subdomain1'
${hostpart4} == None

I'm not sure, maybe that's too specific to my needs. Maybe just ${subdomain}
for the last subdomain ("subdomain1") is enough.

Do you think I can solve my problem using multiple redirections, like this:
sub.domain.com/hello -> domain.com/sub.domain.com/hello (using the RE I
wrote before)
domain.com/sub.domain.com/hello -> domain.com/sub/hello (using a new RE)

Would that be possible? I mean, can I create the new splitting mechanism
using a new RE redirection?

Thank you.


2010/9/1 Alvaro Lopez Ortega <[email protected]>

> Hello there,
>
> On 01/09/2010, at 10:21, Yo'av Moshe wrote:
>
> > I'm trying to solve this using the new ${host} macro and I'm getting
> pretty close, but I still need your help.
> >
> > I'm just learning how to use RE, and this is what I came up with:
> >
> > 1 - Creating a behavior rule based on host which is not my main domain
> > 2 - Using a redirection handler with it.
> > 3 - Choosing internal redirection.
> > 4 - using this RE: ^/(.*)$ -> maindomain.com/${host}/$1
> >
> > This seems to work fine, but ${host} gives me the whole hostname
> obviously.
> >
> > How can I cut just the first part of it, before the dot? (something like
> host.split('.')[0] in python)
>
> Currently strings can be sliced, but I'm afraid there is no way to split()
> them.
>
> It's documented at the end of this page:
>
>  http://www.cherokee-project.com/doc/config_virtual_servers_evhost.html
>
> What new variables would you need, BTW?
>
> Cheers,
>
> --
> Octality
> http://www.octality.com/
>
>

-- 
Yo'av Moshe
_______________________________________________
Cherokee mailing list
[email protected]
http://lists.octality.com/listinfo/cherokee

Reply via email to