Symfony dynamic subdomains

Posted by Jamie on Stack Overflow See other posts from Stack Overflow or by Jamie
Published on 2010-06-07T12:40:49Z Indexed on 2010/06/08 0:22 UTC
Read the original article Hit count: 707

Filed under:
|
|
|

Hi all,

I'm trying to match subdomains to a customer id in symfony.

i.e. i have customer1.example.com and customer2.example.com

Domains are stored in a table.

When a user goes to customer1.example.com, I would like to get the subdomain, look up the domain name in the database, once matched, it will then deploy the app config for that customer and then store the customer_Id in a global attribute so i know exactly which customer I'm dealing with througout the whole application. The virtual host will have the relevant wildcard servername.

Have you managed to achieve this, and if so, how? If not, any ideas would be a great help!

I'm thinking about using a filter to do it.

:-)

© Stack Overflow or respective owner

Related posts about php

Related posts about symfony