This appears to be the scariest topic relating to Symfony2, as after a week of searching and testing, I am still unable to find an answer to this.
In short, I am buildin
Sorry for necroing...
I just want to say that I have looked into multiple application structure for Symfony2 as well. Since version 2.4, when routing supported hostname based routing, there has been no need for multiple apps.
All you now need to do is separate your "apps" into different bundles, say AcmeSiteBundle
and AcmeApiBundle
, then in app/config/routing.yml
:
acme_site:
host: "www.{domain}"
resource: "@AcmeSiteBundle/Resources/config/routing.yml"
prefix: /
defaults:
domain: "%domain%"
requirements:
domain: "%domain%"
acme_api:
host: "api.{domain}"
resource: "@AcmeApiBundle/Resources/config/routing.yml"
prefix: /
defaults:
domain: "%domain%"
requirements:
domain: "%domain%"
Remember to have domain
parameter set in app/config/parameters.yml
parameters:
.....
domain: example.com