Hi Alvaro,

thanks for the reply, that was really quick :)

I've read the redirs cookbook and handlers redir examples mutiple
times now,  but
somehow I don't seem to get it right :(

I can set up external redirects just fine, so "sub.domain.com" 301-redirects
to "domain.com/sub" (browser changes URL as well)

What I need is an "internal redirect" or "rewrite", so the browser stays
at "sub.domain.com" (no 301) and only internally is served from
"domain.com/sub"

Here's my setup, maybe you can point me to where my limitations are?

Host Match for virtual host:
^(.*)\.domain\.com$

Rule:
Header->Host->matches regex: ^(.*)\.domain\.com$

Handler:
RegEx  ^(.*)$
Substitution
http://domain.com/^1$1

As long as the handler type is external, this does a correct 301 redirect
(which I don't want): test.domain.com - 301 -> domain.com/test

But when I then switch the handler type to "internal" I just get "500
Internal Server Error"
so that seems to be the place where I am stuck...

Thank you so much!
--
Steffen
- Hide quoted text -

On Wed, Sep 7, 2011 at 07:42, Alvaro Lopez Ortega <[email protected]> wrote:
> Hello Steffen,
>
> On Wed, Sep 7, 2011 at 12:19 AM, Steffen Schneider <[email protected]> wrote:
>>
>> I'm having a tough time setting up an internal redirection based on
>> the subdomains:
>>
>> sub.domain.com -> domain.com/sub
>>
>> I've managed to set up an external redirection just fine, but that's
>> not excatly what I need :-/
>> It would be more of a "rewrite", so the browser keeps showing
>> "sub.domain.com".
>>
>> There must be a way to do this, as with any other webserver,
>> would somebody enlighten me on this one?
>
> You have to use the ^-replacements. Please, this documentation page for
> details - specially the “Global redirections” section.
> Cheers!
>
> --
> Greetings, alo
> http://www.octality.com/
>
_______________________________________________
Cherokee mailing list
[email protected]
http://lists.octality.com/listinfo/cherokee

Reply via email to