[web-devel] happstack subdomain routing
Jeremy Shaw
jeremy at n-heptane.com
Sun May 27 22:28:00 CEST 2012
Hello,
You can use the 'host' or 'withHost' combinators:
http://www.happstack.com/docs/happstack-server-7.0.2/doc/html/happstack-server/Happstack-Server-Routing.html#v:host
Those are actually intended for virtual hosts where you match on the
whole domain. I suppose we could add a variant that makes it easier to
match just the sub-domain portion. Not quite sure what the rules for
that would be though. For most domains, you just drop the last two
parts:
foo.example.org -> foo
But, for .co.uk address that would be a bit funny:
foo.example.co.uk -> foo.example
So.. we need to figure out a more sensible rule.. Or you just need to
match on the FQDN.
Is there some correct way to identify a sub-domain? Maybe we just take
everything before the first . and consider that the sub-domain?
- jeremy
On Sun, May 27, 2012 at 2:47 PM, Asafe Ribeiro <asafe.hai.kai at gmail.com> wrote:
> How do I do subdomain routing on happstack?
>
> _______________________________________________
> web-devel mailing list
> web-devel at haskell.org
> http://www.haskell.org/mailman/listinfo/web-devel
More information about the web-devel
mailing list