[LRUG] [OT:Apache] Mapping multiple domains to different controllers?

Jon Lim snowblink at gmail.com
Tue Apr 14 02:33:36 PDT 2009


Maybe ServerAlias is the directive you are looking for?

On Tue, Apr 14, 2009 at 00:50, Matthew Rudy Jacobs
<matthewrudyjacobs at gmail.com> wrote:
> Hey,
> I know this isn't ruby,
> but I can't work this out.
>
> It's kind of the opposite to the old "http://mydomain/app1" and
> "http://mydomain/app2" pointing to two different applications.
>
> What I want is "http://domain1" and "http://domain2"  to point to the
> same rails app, but transparently rewritten to /domain1 and /domain2
>
> And I was hoping there might be an apache guru looking for a way of
> wasting time.
>
> Boiling it down;
>
> I have an app that lives at; ~/myapp
> it has a public directory at: ~/myapp/public
>
> This runs happily on MyDomain.com
>
> I have a controller OtherDomainController
> with the path /other_domain
> and the static directory ~/myapp/public/other_domain
>
> I want to setup a VHost for SomethingElse.com,
> so that;
>
> 1. A request to "http://SomethingElse.com" should return the same
> content as one to "http://MyDomain.com/other_domain"
> 2. It should achieve this without redirecting
> 3. It should serve ~/myapp/public/other_domain/index.htm to requests
> for "http://SomethingElse.com/" if it is present
>
> I have a gist - http://gist.github.com/94828
> with a couple of things I've tried...
>
> but I'm stumped.
>
> Doing a normal redirect is fine,
> but I don't want to issue a 302, I just want apache to deal with the
> redirect internally (and [P] seems to break)
> and I can't seem to make ModProxy work for me.
>
> Any ideas as to where I'm going wrong?
> Maybe its ModAlias I should be using.
>
> I've thought of ways of doing it with a rack pre-processor,
> but surely apache eats this stuff for brunch?
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>



-- 
http://snowblink.co.uk/



More information about the Chat mailing list