[Catalyst] Mapping another site to a subset of a Catalyst application

Brian Kirkbride brian.kirkbride at deeperbydesign.com
Wed Jun 6 01:06:21 GMT 2007


Hello all,

I've got an Catalyst webapp that has several areas:

/admin/...
/manage/...
/client/...

All of these are accessible from one site:

mysite.com/admin
mysite.com/manage
mysite.com/client

Now, here's the tricky part.  I'd really like to have a proxy or
URL-rewriting setup that allowed for:

client1.com/abc (handled by /client/abc)
client2.com/abc (handled by /client/abc)
client3.com/xyz (handled by /client/xyz)

I'm currently using FastCGI and it's not a problem to map multiple
virtual hosts to the Catalyst app.  I can even setup Apache to do
an Alias / /path/to/myapp_fastcgi.pl/client/, which starts to do what
I want.  The problem is that $c->uri_for will always return something
like http://client1.com/client/... for any action I need the URI to.

I'm sure there is a better way to do this?  I suppose that I could
override uri_for() to strip ^/client if the HTTP_HOST is not
mysite.com but that seems ugly.

Thanks in advance!

Best,
Brian Kirkbride



More information about the Catalyst mailing list